Skip to content

Commit 1fd44b2

Browse files
authored
Add store and metadata to LLMs (#1220)
1 parent 479657f commit 1fd44b2

File tree

1 file changed

+8
-0
lines changed
  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai

1 file changed

+8
-0
lines changed

livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py

+8
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class LLMOptions:
6363
temperature: float | None
6464
parallel_tool_calls: bool | None
6565
tool_choice: Union[ToolChoice, Literal["auto", "required", "none"]] = "auto"
66+
store: bool | None = None
67+
metadata: dict[str, str] | None = None
6668

6769

6870
class LLM(llm.LLM):
@@ -77,6 +79,8 @@ def __init__(
7779
temperature: float | None = None,
7880
parallel_tool_calls: bool | None = None,
7981
tool_choice: Union[ToolChoice, Literal["auto", "required", "none"]] = "auto",
82+
store: bool | None = None,
83+
metadata: dict[str, str] | None = None,
8084
) -> None:
8185
"""
8286
Create a new instance of OpenAI LLM.
@@ -93,6 +97,8 @@ def __init__(
9397
temperature=temperature,
9498
parallel_tool_calls=parallel_tool_calls,
9599
tool_choice=tool_choice,
100+
store=store,
101+
metadata=metadata,
96102
)
97103
self._client = client or openai.AsyncClient(
98104
api_key=api_key,
@@ -738,6 +744,8 @@ async def _run(self) -> None:
738744
stream_options={"include_usage": True},
739745
stream=True,
740746
user=user,
747+
store=self._llm._opts.store,
748+
metadata=self._llm._opts.metadata,
741749
**opts,
742750
)
743751

0 commit comments

Comments
 (0)