yomorun / yomo

🦖 Stateful Serverless Framework for Geo-distributed Edge AI Infra. with function calling support, write once, run on any model.
https://yomo.run
Apache License 2.0
1.65k stars 128 forks source link

feat: add Google Gemini API provider (#2) #742

Closed fanweixiao closed 6 months ago

fanweixiao commented 6 months ago

Related Docs:

How to use this provider

bridge:
  ai:
    server:
      addr: localhost:8000
      provider: gemini

    providers:
      gemini:
        api_key: <your-api-key>

Be careful that

  1. The data format describes in api doc is different from actual api. These can be found from the unit tests.
  2. You can not set your function with - as this will break your api response. Google will drop characters of the function name in its response. So, I have to check this -, and replace to _ if it presence.
vercel[bot] commented 6 months ago

@fanweixiao is attempting to deploy a commit to the YoMo Team on Vercel.

A member of the Team first needs to authorize it.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 71.76471% with 72 lines in your changes are missing coverage. Please review.

Project coverage is 60.04%. Comparing base (b5317dc) to head (135bc0f).

Files Patch % Lines
pkg/bridge/ai/provider/gemini/provider.go 56.87% 68 Missing and 1 partial :warning:
pkg/bridge/ai/provider/gemini/model_converter.go 96.84% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #742 +/- ## ========================================== + Coverage 59.20% 60.04% +0.83% ========================================== Files 42 44 +2 Lines 3226 3481 +255 ========================================== + Hits 1910 2090 +180 - Misses 1202 1274 +72 - Partials 114 117 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.