Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
update image assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Jan 16, 2024
1 parent 5b69245 commit ea941be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions ai/assistants/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
from phi.llm.openai import OpenAIChat

from ai.settings import ai_settings
from ai.storage import vision_assistant_storage
from ai.storage import image_assistant_storage


def get_image_assistant(
run_id: Optional[str] = None,
user_id: Optional[str] = None,
debug_mode: bool = False,
) -> Assistant:
"""Get a Vision Assistant"""
"""Get an Image Assistant"""

return Assistant(
name="vision_assistant",
name="image_assistant",
run_id=run_id,
user_id=user_id,
llm=OpenAIChat(
model=ai_settings.gpt_4_vision,
max_tokens=ai_settings.default_max_tokens,
temperature=ai_settings.default_temperature,
),
storage=vision_assistant_storage,
storage=image_assistant_storage,
monitoring=True,
debug_mode=debug_mode,
assistant_data={"assistant_type": "vision"},
assistant_data={"assistant_type": "multimodal"},
)
2 changes: 0 additions & 2 deletions ai/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class AISettings(BaseSettings):
gpt_4: str = "gpt-4-1106-preview"
gpt_4_vision: str = "gpt-4-vision-preview"
gpt_3_5: str = "gpt-3.5-turbo-1106"
dall_e: str = "dall-e-3"
whisper: str = "whisper-1"
embedding_model: str = "text-embedding-ada-002"
default_max_tokens: int = 1024
default_temperature: float = 0
Expand Down
4 changes: 2 additions & 2 deletions ai/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
table_name="pdf_assistant",
)

vision_assistant_storage = PgAssistantStorage(
image_assistant_storage = PgAssistantStorage(
schema="ai",
db_url=db_url,
table_name="vision_assistant",
table_name="image_assistant",
)

website_assistant_storage = PgAssistantStorage(
Expand Down

0 comments on commit ea941be

Please sign in to comment.