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
5 changes: 3 additions & 2 deletions backend/app/crud/assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def sync_assistant(
Insert an assistant into the database by converting OpenAI Assistant to local Assistant model.
"""
assistant_id = openai_assistant.id

existing_assistant = get_assistant_by_id(session, assistant_id, project_id)
if existing_assistant:
logger.warning(
Expand Down Expand Up @@ -148,7 +147,9 @@ def sync_assistant(
instructions=openai_assistant.instructions,
model=openai_assistant.model,
vector_store_ids=vector_store_ids,
temperature=openai_assistant.temperature or 0.1,
temperature=openai_assistant.temperature
if openai_assistant.temperature is not None
else 0,
max_num_results=max_num_results,
project_id=project_id,
organization_id=organization_id,
Expand Down
4 changes: 2 additions & 2 deletions backend/app/models/assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AssistantCreate(SQLModel):
description="List of Vector Store IDs that exist in OpenAI.",
)
temperature: float = Field(
default=0.1, gt=0, le=2, description="Sampling temperature between 0 and 2"
default=0.1, ge=0, le=2, description="Sampling temperature between 0 and 2"
)
max_num_results: int = Field(
default=20,
Expand All @@ -91,7 +91,7 @@ class AssistantUpdate(SQLModel):
vector_store_ids_add: list[str] | None = None
vector_store_ids_remove: list[str] | None = None
temperature: float | None = Field(
default=None, gt=0, le=2, description="Sampling temperature between 0 and 2"
default=None, ge=0, le=2, description="Sampling temperature between 0 and 2"
)
max_num_results: int | None = Field(
default=None,
Expand Down