You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @JarbasAl.
* #37 (comment)
The following files were modified:
* `ovos_solver_openai_persona/engines.py`
* `ovos_solver_openai_persona/rag.py`
* `setup.py`
Generates a chat response using the provided message history and updates memory if enabled.
265
-
266
-
If the first message is not a system prompt, prepends the system prompt. Processes the API response and returns a cleaned answer, or None if the answer is empty or only punctuation/underscores. Updates internal memory with the latest question and answer if memory is enabled.
267
-
268
-
Args:
269
-
messages: List of chat messages with 'role' and 'content' keys.
270
-
lang: Optional language code for the response.
271
-
units: Optional unit system for numerical values.
272
-
273
-
Returns:
274
-
The generated response as a string, or None if no valid response is produced.
275
-
"""
264
+
Generate a chat response based on the provided message history and update conversation memory if enabled.
265
+
266
+
If the first message is not a system prompt, prepends the system prompt. Returns a cleaned response string, or None if the response is empty or contains only punctuation or underscores. Updates internal memory with the latest user message and answer when memory is enabled.
267
+
268
+
Parameters:
269
+
messages (MessageList): List of chat messages, each with 'role' and 'content' keys.
270
+
lang (Optional[str]): Language code for the response.
271
+
units (Optional[str]): Unit system for numerical values.
272
+
273
+
Returns:
274
+
Optional[str]: The generated response string, or None if no valid response is produced.
Stream utterances for the given chat history as they become available.
292
-
293
-
Args:
294
-
messages: The chat messages.
295
-
lang (Optional[str]): Optional language code. Defaults to None.
296
-
units (Optional[str]): Optional units for the query. Defaults to None.
297
-
298
-
Returns:
299
-
Iterable[str]: An iterable of utterances.
300
-
"""
291
+
Streams partial assistant responses for a chat conversation as they are generated.
292
+
293
+
Yields post-processed segments of the assistant's reply, emitting each chunk when a sentence or phrase boundary is detected. If conversation memory is enabled, updates the internal memory with the accumulating answer.
0 commit comments