Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/gaia/governance/checkpoint_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@

from threading import Lock

from typing import cast

from .exceptions import CheckpointNotFoundError, InvalidResolutionError
from .schemas import (
CheckpointRecord,
CheckpointResolution,
CheckpointStatus,
GovernanceDecision,
TransitionOutcome,
WorkflowTransition,
Expand Down Expand Up @@ -90,7 +93,7 @@ def resolve_checkpoint(
checkpoint_id=current.checkpoint_id,
workflow_id=current.workflow_id,
transition_id=current.transition_id,
status=status,
status=cast(CheckpointStatus, status),
created_at=current.created_at,
decision_context={
**current.decision_context,
Expand Down
2 changes: 1 addition & 1 deletion src/gaia/llm/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ def create_client(
module = importlib.import_module(module_path)
provider_class = getattr(module, class_name)

return provider_class(**kwargs)
return provider_class(**kwargs) # type: ignore[no-any-return]
5 changes: 3 additions & 2 deletions src/gaia/llm/providers/claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def chat(
response = self._client.messages.create(**params)
if stream:
return self._handle_stream(response)
return response.content[0].text
return response.content[0].text # type: ignore[union-attr]

# embed() inherited from ABC - raises NotSupportedError

Expand All @@ -99,7 +99,8 @@ def vision(self, images: list[bytes], prompt: str, **kwargs) -> str:
],
}
]
return self.chat(messages, **kwargs)
result = self.chat(messages, **kwargs)
return result if isinstance(result, str) else "".join(result)

# get_performance_stats() inherited from ABC - raises NotSupportedError
# load_model() inherited from ABC - raises NotSupportedError
Expand Down
10 changes: 5 additions & 5 deletions src/gaia/llm/providers/lemonade.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ class LemonadeContextOverflowError(LemonadeError):

``retryable`` is dynamic — set in ``_classify_lemonade_response`` based
on the reported ``n_ctx``. When n_ctx is smaller than GAIA's expected
32K, the model was loaded with the wrong ctx_size; reloading via the
pre-flight helper will fix it, so we mark retryable so the chat layer
auto-recovers. When n_ctx is already at full size, this is a genuine
"conversation too big" situation and retry won't help.
65536 (64K), the model was loaded with the wrong ctx_size; reloading
via the pre-flight helper will fix it, so we mark retryable so the
chat layer auto-recovers. When n_ctx is already at full size, this is
a genuine "conversation too big" situation and retry won't help.
"""

retryable = False # default; set True dynamically when n_ctx < 32K
retryable = False # default; set True dynamically when n_ctx < 65536
user_message = (
"This conversation got too long for the model's context window. "
"Start a fresh task to keep going."
Expand Down
2 changes: 1 addition & 1 deletion src/gaia/llm/providers/openai_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def chat(
)
if stream:
return self._handle_stream(response)
return response.choices[0].message.content
return response.choices[0].message.content # type: ignore[union-attr]

def embed(
self, texts: list[str], model: str = "text-embedding-3-small", **kwargs
Expand Down
Loading
Loading