Close local release-quality gaps and reconcile workplan status
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a0e332-3365-77c0-8491-084e9ea33ac1
This commit is contained in:
parent
37436bb562
commit
7cd633986e
56 changed files with 462 additions and 237 deletions
|
|
@ -3,14 +3,14 @@ Google Gemini adapter — calls the Generative Language REST API directly.
|
|||
"""
|
||||
|
||||
import time
|
||||
from typing import Optional, Dict, Any
|
||||
from typing import Any
|
||||
|
||||
from llm_connect.adapter import LLMAdapter
|
||||
from llm_connect.models import RunConfig, LLMResponse
|
||||
from llm_connect.config import resolve_api_key, find_project_root
|
||||
from llm_connect._http import post_json
|
||||
from llm_connect._payload import merge_gemini_model_params
|
||||
from llm_connect.adapter import LLMAdapter
|
||||
from llm_connect.config import find_project_root, resolve_api_key
|
||||
from llm_connect.exceptions import LLMConfigurationError
|
||||
from llm_connect.models import LLMResponse, RunConfig
|
||||
|
||||
_DEFAULT_MODEL = "gemini-2.5-flash"
|
||||
_API_BASE = "https://generativelanguage.googleapis.com/v1beta"
|
||||
|
|
@ -24,9 +24,9 @@ class GeminiAdapter(LLMAdapter):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
model: Optional[str] = None,
|
||||
api_key: Optional[str] = None,
|
||||
system_prompt: Optional[str] = None,
|
||||
model: str | None = None,
|
||||
api_key: str | None = None,
|
||||
system_prompt: str | None = None,
|
||||
**_kwargs: Any,
|
||||
):
|
||||
self._model = model or _DEFAULT_MODEL
|
||||
|
|
@ -53,7 +53,7 @@ class GeminiAdapter(LLMAdapter):
|
|||
model = self._model
|
||||
|
||||
# Build Gemini request
|
||||
contents: list[Dict[str, Any]] = []
|
||||
contents: list[dict[str, Any]] = []
|
||||
if self._system_prompt:
|
||||
contents.append({
|
||||
"role": "user",
|
||||
|
|
@ -68,7 +68,7 @@ class GeminiAdapter(LLMAdapter):
|
|||
"parts": [{"text": prompt}],
|
||||
})
|
||||
|
||||
payload: Dict[str, Any] = {
|
||||
payload: dict[str, Any] = {
|
||||
"contents": contents,
|
||||
"generationConfig": {
|
||||
"temperature": config.temperature,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue