chat • AI Agent SDK

chat: Send a message to the remote agent or handle local session.

chat

Method

</div>

This is a method of the Session class in the session module.

Send a message to the remote agent or handle local session.

Signature

python
def chat(message: str) -> str

Parameters

ParamField str

The message to send to the agent **kwargs: Additional parameters for the request

Returns

ResponseField str

The agent’s response

Exceptions

ValueError

If this is not a remote session

ConnectionError

If unable to communicate with remote agent

Uses

  • ValueError
  • requests.post
  • response.raise_for_status
  • response.json
  • ConnectionError

Used By

Source

View on GitHub

praisonaiagents/session.py at line 482


Related Documentation