Base OpenAI LLM service

This commit is contained in:
Moishe Lettvin
2024-03-08 11:09:16 -05:00
parent c75a3fb0d0
commit d9378e23ba
15 changed files with 558 additions and 221 deletions

View File

@@ -1,5 +1,7 @@
from dataclasses import dataclass
from typing import Any
from typing import Any, List
from dailyai.services.openai_llm_context import OpenAILLMContext
class Frame:
@@ -60,7 +62,12 @@ class TranscriptionQueueFrame(TextFrame):
@dataclass()
class LLMMessagesQueueFrame(Frame):
messages: list[dict[str, str]] # TODO: define this more concretely!
messages: List[dict]
@dataclass()
class OpenAILLMContextFrame(Frame):
context: OpenAILLMContext
class AppMessageQueueFrame(Frame):
@@ -79,4 +86,4 @@ class LLMFunctionStartFrame(Frame):
@dataclass()
class LLMFunctionCallFrame(Frame):
function_name: str
arguments: str
arguments: str