fed8b2eed7
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Backend release / release (push) Has been cancelled
Bandit Security Scan / bandit_scan (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / manifest (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / manifest (push) Has been cancelled
Python linting / ruff (push) Has been cancelled
Run python tests with pytest / Run tests and count coverage (3.12) (push) Has been cancelled
React Widget Build / build (push) Has been cancelled
24 lines
653 B
Python
24 lines
653 B
Python
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from application.llm.google_ai import GoogleLLM
|
|
from application.llm.providers._apikey_or_llm_name import (
|
|
filter_models_by_llm_name,
|
|
get_api_key,
|
|
)
|
|
from application.llm.providers.base import Provider
|
|
|
|
|
|
class GoogleProvider(Provider):
|
|
name = "google"
|
|
llm_class = GoogleLLM
|
|
|
|
def get_api_key(self, settings) -> Optional[str]:
|
|
return get_api_key(settings, self.name, settings.GOOGLE_API_KEY)
|
|
|
|
def filter_yaml_models(self, settings, models):
|
|
return filter_models_by_llm_name(
|
|
settings, self.name, settings.GOOGLE_API_KEY, models
|
|
)
|