This commit is contained in:
Paul Kompfner
2025-08-19 14:47:03 -04:00
parent 93c7e64995
commit 37be8805f4
3 changed files with 10 additions and 11 deletions

View File

@@ -81,9 +81,9 @@ class GoogleLLMOpenAIBetaService(OpenAILLMService):
await self.start_ttfb_metrics()
chunk_stream: AsyncStream[ChatCompletionChunk] = await self._stream_chat_completions_specific_context(
context
)
chunk_stream: AsyncStream[
ChatCompletionChunk
] = await self._stream_chat_completions_specific_context(context)
async for chunk in chunk_stream:
if chunk.usage:

View File

@@ -213,16 +213,15 @@ class BaseOpenAILLMService(LLMService):
chunks = await self._client.chat.completions.create(**params)
return chunks
def build_chat_completion_params(
self, params_from_context: OpenAILLMInvocationParams
) -> dict:
def build_chat_completion_params(self, params_from_context: OpenAILLMInvocationParams) -> dict:
"""Build parameters for chat completion request.
Subclasses can override this to customize parameters for different providers.
Args:
context: The LLM context containing tools and configuration.
messages: List of chat completion messages to send.
params_from_context: Parameters, derived from the LLM context, to
use for the chat completion. Contains messages, tools, and tool
choice.
Returns:
Dictionary of parameters for the chat completion request.

View File

@@ -122,9 +122,9 @@ class SambaNovaLLMService(OpenAILLMService): # type: ignore
await self.start_ttfb_metrics()
chunk_stream: AsyncStream[ChatCompletionChunk] = await self._stream_chat_completions_specific_context(
context
)
chunk_stream: AsyncStream[
ChatCompletionChunk
] = await self._stream_chat_completions_specific_context(context)
async for chunk in chunk_stream:
if chunk.usage: