Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Unable to set CORS headers using dangerouslyAllowBrowser in llmConfig #152

Open
dannleft opened this issue Nov 18, 2024 · 0 comments
Labels

Comments

@dannleft
Copy link
Collaborator

Describe the Bug

When attempting to set the dangerouslyAllowBrowser: true option in llmConfig under clientOptions, the expected behavior of bypassing CORS issues does not occur. This requires the use of additional tools like a proxy or disabling web security in the browser to make the calls work locally.

KaibanJS Team Config

const agent = new Agent({
  name: 'Test Agent',
  role: 'Assistant',
  llmConfig: {
    provider: 'openai',
    model: 'gpt-4',
    clientOptions: {
      dangerouslyAllowBrowser: true,
    },
  },
});

Steps to Reproduce

  1. Set up a basic KaibanJS agent using the above configuration.
  2. Attempt to run the agent locally on a browser with CORS enabled.
  3. Observe that the call fails unless CORS is bypassed via browser settings or a proxy.

Current vs. Expected behavior

  • Current Behavior: Calls to LLM providers fail due to CORS restrictions, even when dangerouslyAllowBrowser: true is set in llmConfig.

  • Expected Behavior: The dangerouslyAllowBrowser setting should allow bypassing CORS restrictions, as documented.

Environment

  • Framework/Library: [e.g., React, Vue, NodeJS, Vanilla JavaScript]
  • KaibanJS Version: 0.10.0
  • JavaScript Runtime: [e.g., Chrome, NodeJS]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants