Skip to content

Conversation

ks93
Copy link
Contributor

@ks93 ks93 commented Aug 21, 2025

Description

This PR introduces support for actions within the client.agents.chat feature. This enables more dynamic interactions with AI agents by allowing clients to:

  • Provide client-side tools (actions) to the agent: The chat method now accepts an actions parameter, allowing users to define ClientToolAgentActionWrite objects that the agent can request to execute.
  • Receive action requests from the agent: The AgentMessage in the chat response can now include a list of actions (e.g., ClientToolResponseAction, ToolConfirmationResponseAction), indicating that the agent wants the client to perform a specific operation.
  • Send action results back to the agent: The Message dataclass has been extended to support an "action" role and action_id, allowing users to send the results of a client-executed action back to the agent for continued conversation.

This implementation provides a type-safe and extensible abstraction for handling agent actions, aligning with existing SDK patterns for tools. Comprehensive examples are included in the chat method's docstring to guide users.

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

Open in Cursor Open in Web

Copy link

cursor bot commented Aug 21, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants