Skip to content

Commit

Permalink
Update LLM agent creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nfiacco committed Jun 12, 2024
1 parent 4567d46 commit 18ff7b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions demospace/livekit/openai_assistant/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@

@define
class LLMOptions:
model: str | ChatModels
model: ChatModels


class LLM(llm.LLM):
def __init__(
self,
*,
assistant_id: str,
model: str | ChatModels = "gpt-4o",
client: openai.AsyncClient | None = None,
room: rtc.Room,
model: ChatModels = "gpt-4o",
client: openai.AsyncClient | None = None,
) -> None:
self.assistant_id = assistant_id
self._opts = LLMOptions(model=model)
self._client = client or openai.AsyncClient()
self.assistant_id: str = assistant_id
self._room: rtc.Room = room
self._opts: LLMOptions = LLMOptions(model=model)
self._client: openai.AsyncClient = client or openai.AsyncClient()
self._running_fncs: MutableSet[asyncio.Task] = set()
self._thread: openai.Thread = None
self._active_run: openai.Run = None
self._room: rtc.Room = room

async def _cancel_active_runs(self) -> None:
try:
Expand Down

0 comments on commit 18ff7b0

Please sign in to comment.