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

Application error: a client-side exception has occurred #10

Closed
0smboy opened this issue Apr 9, 2024 · 22 comments
Closed

Application error: a client-side exception has occurred #10

0smboy opened this issue Apr 9, 2024 · 22 comments

Comments

@0smboy
Copy link

0smboy commented Apr 9, 2024

When I search in Chinese for "周杰伦是谁?" I get the following question
image

@Adarshagupta
Copy link

Same Problem. With all language

@miurla miurla added the bug Something isn't working label Apr 10, 2024
@onlinedear
Copy link

确实存在这个问题 希望能修复这个bug
此外希望一键部署的Velcal自定义参数字段里,支持openai代理地址的填写

@onlinedear
Copy link

微信图片_20240411131519

@miurla
Copy link
Owner

miurla commented Apr 11, 2024

@0smboy

I tried the phrase "周杰伦是谁?" several times in morphic.sh, but I couldn't reproduce the issue. Please provide the following three points of information:

  1. In which environment did the issue occur?
    1. Your local environment
    2. Your hosting
    3. Did you change the OpenAI model?
  2. Does it occur in morphic.sh?
  3. At what point does the crash occur?
  4. How frequently does the issue occur?

@miurla
Copy link
Owner

miurla commented Apr 11, 2024

@onlinedear

Thank you for sharing the preview URL.
I was able to confirm the reproduction of the issue.
(Please remove the preview URL from the comments, as it is publicly accessible)

Could you please provide the error logs from the Logs tab on the Vercel dashboard?

@onlinedear
Copy link

I hope to have the option to fill in the proxy address before entering the OPENAI_API_KEY parameter on Vercel.

@miurla
Copy link
Owner

miurla commented Apr 11, 2024

@onlinedear

Could you please provide the error logs from the Logs tab on the Vercel dashboard?

@onlinedear

This comment was marked as resolved.

@onlinedear
Copy link

It seems that this error is due to insufficient quota for my account. Can you support Azure's API?

@onlinedear
Copy link

I hope to be able to fill in OPENAI_API_BASE= in the custom parameters on Vercel, and it would be great if Azure's API was supported.

@miurla
Copy link
Owner

miurla commented Apr 11, 2024

It seems that this error is due to insufficient quota for my account

🫠

Can you support Azure's API?

#13

@miurla
Copy link
Owner

miurla commented Apr 11, 2024

@0smboy @Adarshagupta

Could you please check the error logs from the Logs tab on the Vercel dashboard?
If it is an account issue, this issue will be closed

@miurla miurla removed the bug Something isn't working label Apr 11, 2024
@onlinedear
Copy link

I hope to be able to fill in OPENAI_API_BASE= in the custom parameters on Vercel,

@miurla
Copy link
Owner

miurla commented Apr 11, 2024

I hope to be able to fill in OPENAI_API_BASE= in the custom parameters on Vercel,

The contributors have already addressed this.

Unrelated matters should be commented on in a separate issue.
Otherwise, it becomes difficult to track the problem.

@onlinedear
Copy link

我希望能够在Vercel上的自定义参数中填写OPENAI_API_BASE=,

贡献者已经解决了这个问题。

不相关的事项应在单独的问题中发表评论。 否则,很难跟踪问题。

Thank you very much for sharing such a great project, and also for your patient answers. I hope the project continues to improve and thrive.

@Linon419
Copy link

Linon419 commented Apr 12, 2024

  1. Environment: vercel
  2. I am using API from unofficial openai website
  3. Yes, it occurs in morphic.sh
  4. Everytime it occurs

AI_APICallError: An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_B8vABInEqQRC8kKOhg7vpsK5 (request id: 20240412073901920078704LWkxZBBt)
at (node_modules/ai/openai/dist/index.mjs:448:0)
at (node_modules/ai/openai/dist/index.mjs:340:0)
at (node_modules/ai/openai/dist/index.mjs:807:0)
at (node_modules/ai/dist/index.mjs:658:0)
at (node_modules/ai/dist/index.mjs:1352:0)
at (lib/agents/query-suggestor.tsx:24:2)
at (app/action.tsx:69:4) {
name: 'AI_APICallError',
url: 'https://xxx.xxx/v1/chat/completions',
requestBodyValues: {
model: 'gpt-4-turbo-preview',
logit_bias: undefined,
user: undefined,
max_tokens: undefined,
temperature: undefined,
top_p: undefined,
frequency_penalty: undefined,
presence_penalty: undefined,
seed: undefined,
messages: [
{
role: 'system',
content: 'As a professional web researcher, your task is to generate a set of three queries that explore the subject matter more deeply, building upon the initial query and the information uncovered in its search results.\n\n For instance, if the original query was "Starship's third test flight key milestones", your output should follow this format:\n\n "{\n "related": [\n "What were the primary objectives achieved during Starship's third test flight?",\n "What factors contributed to the ultimate outcome of Starship's third test flight?",\n "How will the results of the third test flight influence SpaceX's future development plans for Starship?"\n ]\n }"\n\n Aim to create queries that progressively delve into more specific aspects, implications, or adjacent topics related to the initial query. The goal is to anticipate the user's potential information needs and guide them towards a more comprehensive understanding of the subject matter.\n '
},
{
role: 'user',
content: [ { type: 'text', text: '{"input":"美国加息"}' } ]
},
{
role: 'assistant',
content: '\nError occurred while executing the tool',
tool_calls: [
{
id: 'call_B8vABInEqQRC8kKOhg7vpsK5',
type: 'function',
function: {
name: 'search',
arguments: '{"query":"美国加息","max_results":5,"search_depth":"advanced"}'
}
}
]
}
],
tool_choice: { type: 'function', function: { name: 'json' } },
tools: [
{
type: 'function',
function: {
type: 'function',
name: 'json',
description: 'Respond with a JSON object.',
parameters: {
type: 'object',
properties: {
items: {
type: 'array',
items: {
type: 'object',
properties: { query: { type: 'string' } },
required: [ 'query' ],
additionalProperties: false
},
minItems: 3,
maxItems: 3
}
},
required: [ 'items' ],
additionalProperties: false,
$schema: 'http://json-schema.org/draft-07/schema#'
}
}
}
],
stream: true
},
statusCode: 400,
responseBody: '{"error":{"message":"An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_B8vABInEqQRC8kKOhg7vpsK5 (request id: 20240412073901920078704LWkxZBBt)","type":"invalid_request_error","param":"messages","code":null}}',
cause: undefined,
isRetryable: false,
data: {
error: {
message: 'An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_B8vABInEqQRC8kKOhg7vpsK5 (request id: 20240412073901920078704LWkxZBBt)',
type: 'invalid_request_error',
param: 'messages',
code: null
}
}
}

@miurla
Copy link
Owner

miurla commented Apr 12, 2024

at (app/action.tsx:69:4) { name: 'AI_APICallError', url: 'https://xxx.xxx/v1/chat/completions', requestBodyValues: { model: 'gpt-4-turbo-preview',

The URL for OPENAI_API_BASE seems to be incorrect.

@Linon419
Copy link

at (app/action.tsx:69:4) { name: 'AI_APICallError', url: 'https://xxx.xxx/v1/chat/completions', requestBodyValues: { model: 'gpt-4-turbo-preview',

The URL for OPENAI_API_BASE seems to be incorrect.

The URL in my environment is current. I replace it to xxx to arouse suspicion of advertising.

@miurla
Copy link
Owner

miurla commented Apr 12, 2024

Ah, Okay. The search seems to have failed.
Are you sure you entered the correct value for TAVILY_API_KEY?

@Linon419
Copy link

Ah, Okay. The search seems to have failed. Are you sure you entered the correct value for TAVILY_API_KEY?

Yes, all API keys are correct

@miurla
Copy link
Owner

miurla commented Apr 12, 2024

Thank you. I found the cause, so I’ll fix it.

@miurla
Copy link
Owner

miurla commented Apr 12, 2024

I fixed to fill with spaces because an error occurs if the query parameter of the Tavily Search API is less than 5 characters.
Your search query 美国加息 was 4 characters long.
#28

Please use the latest code and try again.

Screenshot 2024-04-13 at 5 22 20

@miurla miurla closed this as completed Apr 13, 2024
miurla added a commit that referenced this issue Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants