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() await self.start_ttfb_metrics()
chunk_stream: AsyncStream[ChatCompletionChunk] = await self._stream_chat_completions_specific_context( chunk_stream: AsyncStream[
context ChatCompletionChunk
) ] = await self._stream_chat_completions_specific_context(context)
async for chunk in chunk_stream: async for chunk in chunk_stream:
if chunk.usage: if chunk.usage:

View File

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

View File

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