Conversation
|
Hey there @tronikos, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Hey there @synesthesiam, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Hey there @home-assistant/core, @synesthesiam, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
| if chat_content.role == "tool_result": | ||
| tool_results.append(chat_content) # type: ignore[arg-type] | ||
|
|
||
| elif tool_results: |
There was a problem hiding this comment.
Will this skip a chat_content after a tool_result? I think this may nee dto be a check inside the else.
| return {"role": role, "parts": message.content} | ||
| def _convert_content(content: conversation.Content) -> genai_types.ContentDict: | ||
| """Convert HA content to Google content.""" | ||
| assert content.role != "tool_result" |
There was a problem hiding this comment.
My impression is that some of the other core members aren't aligned on using assert for typing like this in production code. (and i'm not sure they've suggested an alternative, implicitly suggesting they want untested if statements and assertions for shouldn't happen cases)
There was a problem hiding this comment.
Yeah, I should probably change the typing on content param to fix this.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
* Chat Session rev 2 * Rename session to chat_log * Simplify typing * Typing * Address comments * Fix anthropic and ollama
Breaking change
Proposed change
conversation/session.pytochat_log.py, as that's the names of the classes it holds.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: