Stream chat response tokens from the LLM client. This method provides a streaming interface for chat completions, yielding response tokens as they are generated by the language model. Args: prompt (str): The input prompt to send to the language model.
(self, prompt: str)
| 58 | return self.embedding_client.embed_many(texts) |
| 59 | |
| 60 | async def chat_stream(self, prompt: str): |
| 61 | """ |
| 62 | Stream chat response tokens from the LLM client. |
| 63 | |
| 64 | This method provides a streaming interface for chat completions, yielding |
| 65 | response tokens as they are generated by the language model. |
| 66 | |
| 67 | Args: |
| 68 | prompt (str): The input prompt to send to the language model. |
| 69 | |
| 70 | Yields: |
| 71 | str: Individual response tokens from the streaming completion. |
| 72 | """ |
| 73 | response = await self.llm_client.complete_stream(prompt, max_tokens=ConfigConstants.MAX_TOKENS) |
| 74 | for chunk in response: |
| 75 | yield chunk |
no test coverage detected