Skip to content
Merged
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
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ setup: ## Setup project with examples and database
fi; \
done
@echo "Setting up database..."
@uv run python -m demo_and_setup.first_experiment
@if [ "$(force)" = "true" ]; then \
echo "Force option detected. Recreating database."; \
uv run python -m demo_and_setup.first_experiment --force; \
else \
uv run python -m demo_and_setup.first_experiment; \
fi
@echo "$(GREEN)✅ Setup complete!$(NC)"
@echo "Edit .streamlit/secrets.toml with your credentials"

Expand Down
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
st.write(f"Page mode: `{app_ctx.page_mode}`")
st.write(app_ctx.selected)

experiments_page = st.Page("src/ui/experiments/page.py", title="Experiments", url_path="experiments")
observations_page = st.Page("src/ui/observations/page.py", title="Observations", url_path="observations")
planner_page = st.Page("src/ui/planner/page.py", title="Planner", url_path="planner")
results_page = st.Page("src/ui/results/page.py", title="Results", url_path="results")
experiments_page = st.Page("src/ui/experiments/page.py", title="Experiments", url_path="experiments", icon=":material/science:")
observations_page = st.Page("src/ui/observations/page.py", title="Observations", url_path="observations", icon=":material/table_chart:")
planner_page = st.Page("src/ui/planner/page.py", title="Planner", url_path="planner", icon=":material/event:")
results_page = st.Page("src/ui/results/page.py", title="Results", url_path="results", icon=":material/analytics:")

pg = st.navigation([
experiments_page,
Expand Down
8 changes: 4 additions & 4 deletions assistant/core/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Literal

from pydantic import BaseModel, Field
from pydantic_ai.usage import Usage
from pydantic_ai.usage import RunUsage

from assistant.vdb import VectorDB

Expand Down Expand Up @@ -98,7 +98,7 @@ class OrchestrationResult:

output: AgentsOutput
message_history: list[Any]
usage: Usage
usage: RunUsage
thinking: str | None


Expand All @@ -110,7 +110,7 @@ class AssistantResponse:
"""

output: AgentsOutput
usage: Usage
usage: RunUsage
thinking: str | None


Expand All @@ -123,4 +123,4 @@ class ChatHistory:
"""

message_history: list[Any]
usage: Usage
usage: RunUsage
4 changes: 2 additions & 2 deletions assistant/core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
pass

from cachetools import TTLCache # type: ignore[import-untyped]
from pydantic_ai.usage import Usage
from pydantic_ai.usage import RunUsage

from assistant.core.agents import AgentOrchestrator
from assistant.core.schemas import AssistantResponse, ChatHistory, Deps, UserData
Expand Down Expand Up @@ -46,7 +46,7 @@ async def process_request(self, data: UserData, deps: Deps) -> AssistantResponse
"""

if data.chat_uid not in self.memory:
self.memory[data.chat_uid] = ChatHistory(message_history=[], usage=Usage())
self.memory[data.chat_uid] = ChatHistory(message_history=[], usage=RunUsage())

chat_history = self.memory[data.chat_uid]

Expand Down
6 changes: 3 additions & 3 deletions assistant/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
TextPart,
ThinkingPart,
)
from pydantic_ai.usage import Usage
from pydantic_ai.usage import RequestUsage

from src.logger_setup import logger

Expand Down Expand Up @@ -74,10 +74,10 @@ def drop_empty_messages(messages: list[ModelMessage]) -> list[ModelMessage]:
cleaned.append(
ModelResponse(
parts=res_parts,
usage=getattr(msg, "usage", None) or Usage(),
usage=getattr(msg, "usage", None) or RequestUsage(),
model_name=getattr(msg, "model_name", None),
timestamp=getattr(msg, "timestamp", None) or datetime.now(),
vendor_id=getattr(msg, "vendor_id", None),
provider_response_id=getattr(msg, "provider_response_id", None),
)
)

Expand Down
3 changes: 2 additions & 1 deletion assistant/vdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import TYPE_CHECKING, Literal

import chromadb
from chromadb.config import Settings

from src.logger_setup import logger
from src.services.metric_register import Metrics
Expand Down Expand Up @@ -70,7 +71,7 @@ def __init__(
self.metrics_directory: Path = Path(metrics_directory) if metrics_directory else Path(".")
self.docs_directory: Path = Path(docs_directory)
self.root_directory: Path = Path(root_directory)
self.chroma_client: ClientAPI = chromadb.Client()
self.chroma_client: ClientAPI = chromadb.Client(Settings(anonymized_telemetry=False))
self.metric_collection: chromadb.Collection | None = None
self.docs_collection: chromadb.Collection | None = None
self.code_collection: chromadb.Collection | None = None
Expand Down
Loading