miurla / morphic

An AI-powered search engine with a generative UI
https://morphic.sh
Apache License 2.0
4.98k stars 1.16k forks source link

Support Google Generative AI Provider #156

Closed miurla closed 1 month ago

miurla commented 1 month ago

Is your feature request related to a problem? Please describe. Unable to support models other than OpenAI

Describe the solution you'd like Gemini seems to meet all the requirements

Describe alternatives you've considered Anthropic also meets the requirements

Additional context https://sdk.vercel.ai/providers/ai-sdk-providers/google-generative-ai#model-capabilities

freedomtrain commented 1 month ago

Would it be possible to support https://mistral.ai/

miurla commented 1 month ago

Since Model Capabilities is also checked, support is possible.

https://sdk.vercel.ai/providers/ai-sdk-providers/mistral

miurla commented 1 month ago

I tried it, but some agents are encountering errors.

query-suggestor

APICallError [AI_APICallError]: Function calling with a response mime type: 'application/json' is unsupported

researcher

APICallError [AI_APICallError]: Invalid JSON payload received. Unknown name "maximum" at 'tools.function_declarations[0].parameters.properties[1].value': Cannot find field. Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[0].parameters.properties[1].value': Cannot find field. Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[0].parameters.properties[2].value': Cannot find field.

freedomtrain commented 1 month ago

@miurla Thank you for trying !

miurla commented 1 month ago

The gemini-1.5-pro and gemini-1.5-flash models have gone GA, so they were tested again. An error occurs with tool use.

Error: Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[0].parameters.properties[1].value': Cannot find field.
Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[0].parameters.properties[2].value': Cannot find field.
Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[2].parameters.properties[1].value': Cannot find field.
Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[2].parameters.properties[2].value': Cannot find field. [] true

There is no issue when running a simple sample with the google provider. Since the tool use is set directly in researcher, it seems necessary to fix that.

miurla commented 1 month ago

Error: Invalid JSON payload received. Unknown name "default" at 'tools.function_declarations[0].parameters.properties[1].value': Cannot find field.

This error was resolved by modifying the schema.

However, the following error occurs.

query-suggestor

APICallError [AI_APICallError]: Function calling with a response mime type: 'application/json' is unsupported

freedomtrain commented 1 month ago

it is now possible to support https://mistral.ai/