`geminiAgent` failed by `models/gemini-1.5-flash is not found`
```
$ yarn run sample ./src/interaction/reception_gemini.ts
yarn run v1.22.22
$ npx ts-node ./src/interaction/reception_gemini.ts
✔ You: hello
<-- NodeId: llm, Agent: geminiAgent
{ namedInputs: { messages: [ [Object], [Object] ] } }
GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [404 Not Found] models/gemini-1.5-flash is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.
at handleResponseNotOk (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:434:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async makeRequest (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:403:9)
at async generateContent (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:867:22)
at async ChatSession.sendMessage (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:1210:9)
at async geminiAgent (/home/honma/git/graphai/llm_agents/gemini_agent/lib/gemini_agent.js:154:20)
at async ComputedNode.execute (/home/honma/git/graphai/packages/graphai/lib/node.js:319:28) {
status: 404,
statusText: 'Not Found',
errorDetails: undefined
}
-->
/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:434
throw new GoogleGenerativeAIFetchError(`Error fetching from ${url.toString()}: [${response.status} ${response.statusText}] ${message}`, response.status, response.statusText, errorDetails);
^
GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [404 Not Found] models/gemini-1.5-flash is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.
at handleResponseNotOk (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:434:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async makeRequest (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:403:9)
at async generateContent (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:867:22)
at async ChatSession.sendMessage (/home/honma/git/graphai/node_modules/@google/generative-ai/dist/index.js:1210:9)
at async geminiAgent (/home/honma/git/graphai/llm_agents/gemini_agent/lib/gemini_agent.js:154:20)
at async ComputedNode.execute (/home/honma/git/graphai/packages/graphai/lib/node.js:319:28) {
status: 404,
statusText: 'Not Found',
errorDetails: undefined
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
1 条评论