Skip to the documentation
Python

nextmail.chats

Every method in this namespace: its signature, its parameters, what it returns and an example.

Methods

The conversations held with the assistant in the app: list and search them, read one and its messages, say something and get the reply, stop a reply, approve or deny the tool calls the assistant asks to make, rename a chat and delete it. Each person reaches only their own.

chats.list()

List the assistant chats

Scopesthreads:readPages through results
Signature
def list(    *,    limit: int | None = None,    cursor: str | None = None,    q: str | None = None,    sort: ChatSort | None = None,    api_key: str | None = None,    timeout: float | None = None,) -> Page[ChatResource]

Returns one page of the conversations held with the assistant in the app, newest first, as its assistant panel lists them, each with its title, how many messages it holds and when it last changed.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

limitint

Page size, from 1 to 100. The server defaults to 25.

cursorstr

The nextCursor of the previous page. Leave it out for the first page.

qstr

Searches the titles.

sortChatSort

newest (the default) or oldest by the last change, or title. A cursor carries on in the order it was handed out in.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

Page[ChatResource], a dict with items, hasMore and nextCursor. Each item has id, title, kind, messageCount and updatedAt.

Example

from nextmail import nextmail page = nextmail.chats.list(q='invoices', limit=10) for chat in page['items']:    print(chat['title'], chat['messageCount'], chat['updatedAt']) print('More to read:', page['hasMore'])

Notes

Also available in

API
GET /chats
TypeScript
chats.list()
Ruby
chats.list
PHP
chats->list
Go
Chats.List
Java
chats().list
C#
Chats.ListAsync

chats.list_all()

Collect every chat into one list

Scopesthreads:readPages through results
Signature
def list_all(    *,    limit: int | None = None,    cursor: str | None = None,    q: str | None = None,    sort: ChatSort | None = None,    api_key: str | None = None,    timeout: float | None = None,) -> builtins.list[ChatResource]

Walks every page of list and returns every chat in one list, in the order sort= names. One request per page, with the same filters on each.

Parameters

limitint

Page size for each request, from 1 to 100. The server defaults to 25.

cursorstr

Starts the walk after this cursor instead of the first page.

qstr

Searches the titles.

sortChatSort

newest (the default) or oldest by the last change, or title. A cursor carries on in the order it was handed out in.

api_keystr

Overrides the client API key for every page of this walk.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

list[ChatResource] holding every chat.

Example

from nextmail import nextmail chats = nextmail.chats.list_all() print(len(chats), 'chats holding', sum(chat['messageCount'] for chat in chats), 'messages')

Notes

  • If any page fails, the call raises and the rows already fetched are discarded.

Also available in

API
GET /chats
TypeScript
chats.listAll()
Ruby
chats.list_all
PHP
chats->listAll
Go
Chats.ListAll
Java
chats().listAll
C#
Chats.ListAllAsync

chats.iterate()

Stream the chats one at a time

Scopesthreads:readPages through results
Signature
def iterate(    *,    limit: int | None = None,    cursor: str | None = None,    q: str | None = None,    sort: ChatSort | None = None,    api_key: str | None = None,    timeout: float | None = None,) -> Iterator[ChatResource]

Returns a generator that yields one chat at a time, in the order sort= names, and requests the next page only once the current one is drained. Nothing is fetched until you loop over it, and breaking out of the loop stops the requests.

Parameters

limitint

Page size for each request, from 1 to 100. The server defaults to 25.

cursorstr

Starts the walk after this cursor instead of the first page.

qstr

Searches the titles.

sortChatSort

newest (the default) or oldest by the last change, or title. A cursor carries on in the order it was handed out in.

api_keystr

Overrides the client API key for every page of this walk.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

Iterator[ChatResource], a generator yielding one chat per step.

Example

from nextmail import nextmail for chat in nextmail.chats.iterate(sort='title'):    print(chat['title'], chat['messageCount'])

Notes

  • Each page is one request, so a long walk makes many.

Also available in

API
GET /chats
TypeScript
chats.iterate()
Ruby
chats.iterate
PHP
chats->iterate
Go
Chats.Iterate
Java
chats().iterate
C#
Chats.IterateAsync

chats.get()

Retrieve a chat

Scopesthreads:read
Signature
def get(    id: str,    *,    api_key: str | None = None,    timeout: float | None = None,) -> ChatResource

Returns one chat with the assistant by its id: its title, how many messages it holds and when it last changed.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

ChatResource with id, title, kind, messageCount and updatedAt.

Example

from nextmail import nextmail chat = nextmail.chats.get('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65') print(chat['title'], chat['messageCount'], chat['updatedAt'])

Notes

  • An unknown id is a 404.

Also available in

API
GET /chats/{id}
TypeScript
chats.get()
Ruby
chats.get
PHP
chats->get
Go
Chats.Get
Java
chats().get
C#
Chats.GetAsync

chats.rename()

Rename a chat

Scopesthreads:write
Signature
def rename(    id: str,    title: str,    *,    api_key: str | None = None,    timeout: float | None = None,) -> ChatResource

Gives a chat with the assistant a new title, up to 120 characters, and returns the chat as it is now.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

titlestrRequired

The new title, from 1 to 120 characters.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

ChatResource with the new title.

Example

from nextmail import nextmail chat = nextmail.chats.rename('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65', 'Quarterly invoices') print(chat['id'], chat['title'])

Notes

  • An unknown id is a 404.

  • Retried automatically on network failure, since the same title sent twice changes nothing.

Also available in

API
PATCH /chats/{id}
TypeScript
chats.rename()
Ruby
chats.rename
PHP
chats->rename
Go
Chats.Rename
Java
chats().rename
C#
Chats.RenameAsync

chats.delete()

Delete a chat

Scopesthreads:write
Signature
def delete(    id: str,    *,    api_key: str | None = None,    timeout: float | None = None,) -> DeletedChatResource

Deletes a chat with the assistant and every message in it, for good. Nothing the assistant did in the mailbox is undone.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

DeletedChatResource with object set to chat, the id and deleted set to True.

Example

from nextmail import NextmailApiError, nextmail try:    removed = nextmail.chats.delete('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65')except NextmailApiError as error:    if not error.is_not_found:        raise     print('That chat is already gone')else:    print(removed['id'], removed['deleted'])

Notes

  • An unknown id is a 404, and so is a second call for the same chat.

  • The SDK does not retry it.

Also available in

API
DELETE /chats/{id}
TypeScript
chats.delete()
Ruby
chats.delete
PHP
chats->delete
Go
Chats.Delete
Java
chats().delete
C#
Chats.DeleteAsync

chats.list_messages()

List the messages of a chat

Scopesthreads:readPages through results
Signature
def list_messages(    id: str,    *,    limit: int | None = None,    cursor: str | None = None,    order: ChatMessageOrder | None = None,    api_key: str | None = None,    timeout: float | None = None,) -> Page[ChatMessageResource]

Returns one page of the messages of one chat with the assistant, from the first unless order= is desc: what was said, the tools the assistant called with their results, and the files that came with them. list_all_messages collects every page and iterate_messages walks them lazily.

Each message has text, its words alone, and parts, the message in order: text parts, tool_call parts with the tool, its arguments, its result and its status, and file parts. A tool result the key or app may not read, because it lacks a scope the tool needs, reads as a redacted sentence instead, and so does the answer of a tool that needs no scope for an app acting for a member. The tool, its arguments and its status stay.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

limitint

Page size, from 1 to 50. The server defaults to 20.

cursorstr

The nextCursor of the previous page. Leave it out for the first page.

orderChatMessageOrder

asc (the default) reads the chat from its first message, and desc from its newest. CHAT_MESSAGE_ORDERS holds the values.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

Page[ChatMessageResource], a dict with items, hasMore and nextCursor. Each item has id, chatId, position, role, createdAt, text and parts.

Example

from nextmail import nextmail page = nextmail.chats.list_messages(    '8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65', order='desc', limit=10) for message in page['items']:    print(message['role'], message['text'])

Notes

  • An unknown chat id is a 404.

  • A cursor that does not come from this list, or one handed out before the chat changed under it, is 400 invalid_cursor. Start again without one.

Also available in

API
GET /chats/{id}/messages
TypeScript
chats.listMessages()
Ruby
chats.list_messages
PHP
chats->listMessages
Go
Chats.ListMessages
Java
chats().listMessages
C#
Chats.ListMessagesAsync

chats.list_all_messages()

Collect every message of a chat into one list

Scopesthreads:readPages through results
Signature
def list_all_messages(    id: str,    *,    limit: int | None = None,    cursor: str | None = None,    order: ChatMessageOrder | None = None,    api_key: str | None = None,    timeout: float | None = None,) -> builtins.list[ChatMessageResource]

Walks every page of list_messages and returns every message of the chat in one list, in the order order= names. One request per page, with the same filters on each.

Parameters

idstrRequired

The chat id from list.

limitint

Page size for each request, from 1 to 50. The server defaults to 20.

cursorstr

Starts the walk after this cursor instead of the first page.

orderChatMessageOrder

asc (the default) reads the chat from its first message, and desc from its newest.

api_keystr

Overrides the client API key for every page of this walk.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

list[ChatMessageResource] holding every message of the chat.

Example

from nextmail import nextmail messages = nextmail.chats.list_all_messages('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65') print('\n'.join(f'{message["role"]}: {message["text"]}' for message in messages))

Notes

  • If any page fails, the call raises and the rows already fetched are discarded.

Also available in

API
GET /chats/{id}/messages
TypeScript
chats.listAllMessages()
Ruby
chats.list_all_messages
PHP
chats->listAllMessages
Go
Chats.ListAllMessages
Java
chats().listAllMessages
C#
Chats.ListAllMessagesAsync

chats.iterate_messages()

Stream the messages of a chat one at a time

Scopesthreads:readPages through results
Signature
def iterate_messages(    id: str,    *,    limit: int | None = None,    cursor: str | None = None,    order: ChatMessageOrder | None = None,    api_key: str | None = None,    timeout: float | None = None,) -> Iterator[ChatMessageResource]

Returns a generator that yields one message at a time, in the order order= names, and requests the next page only once the current one is drained. Nothing is fetched until you loop over it, and breaking out of the loop stops the requests.

Parameters

idstrRequired

The chat id from list.

limitint

Page size for each request, from 1 to 50. The server defaults to 20.

cursorstr

Starts the walk after this cursor instead of the first page.

orderChatMessageOrder

asc (the default) reads the chat from its first message, and desc from its newest.

api_keystr

Overrides the client API key for every page of this walk.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

Iterator[ChatMessageResource], a generator yielding one message per step.

Example

from nextmail import nextmail for message in nextmail.chats.iterate_messages('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65'):    for part in message['parts']:        if part['type'] == 'tool_call':            print(part.get('toolName'), part.get('status'))

Notes

  • Each page is one request, so a long walk makes many.

Also available in

API
GET /chats/{id}/messages
TypeScript
chats.iterateMessages()
Ruby
chats.iterate_messages
PHP
chats->iterateMessages
Go
Chats.IterateMessages
Java
chats().iterateMessages
C#
Chats.IterateMessagesAsync

chats.send_message()

Send a message to the assistant

Scopesthreads:write
Signature
def send_message(    id: str,    body: ChatMessageSend,    *,    api_key: str | None = None,    timeout: float | None = None,) -> ChatTurnResource

Says something in the chat and returns once the assistant has replied, in the same chat the app shows. An id that names no chat yet starts one. With regenerate set to True the assistant answers your last message again, and the reply it had is replaced.

The assistant works with the tools the scopes of the key or app reach. A tool that asks for a verification code is never offered, and a tool that changes something waits for an answer: the turn ends with status set to awaiting_approval and names the call in pendingToolCalls, which approve_tool_call or deny_tool_call answers. A call you asked for in so many words runs without waiting, as it does in the app.

A turn runs for at most 240 seconds. Past that it stops with stopReason set to time_limit and keeps what it had written, and stop_turn stops it sooner. One turn runs in a chat at a time.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list, or a new id of at most 64 characters to start a chat.

body['content']str

What you say to the assistant, up to 32,000 characters once trimmed. Required unless regenerate is True.

body['regenerate']bool

True answers your last message again instead of sending a new one. It takes no content and no messageId.

body['messageId']str

An id for your message, unique in this chat, up to 64 characters. Left out, one is made up.

body['attachments']list[ChatAttachmentInput]

Up to 4 files for the assistant to read: a stored file such as {'fileId': 'file_6bb640f5b99e47deb758f1f5'}, or a text file of at most 256 KiB as a dict with filename, content as bytes or a base64 string, and contentType. Bytes are encoded for you.

body['threadId']str

A conversation the chat is about. It is pinned to the chat with its first message, and the assistant reads it before it answers.

body['templateId']str

A template the assistant should work on, as the template editor of the app passes it.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds to wait for the assistant to answer, the response included, before it raises NextmailNetworkError with is_timeout. Left out, it is 300 seconds, or the client's timeout when that is longer, and no limit at all when the client's timeout is 0. 0 waits as long as it takes. A turn that is still running when the wait ends goes on in the chat, so call stop_turn to stop it.

Returns

ChatTurnResource, a dict with object set to chat_turn, chatId, turnId, status (completed, awaiting_approval, stopped or failed, from CHAT_TURN_STATUSES), stopReason, messages (your message and the replies to it), pendingToolCalls and error, which says why a failed turn failed.

Example

from nextmail import nextmail turn = nextmail.chats.send_message(    '8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65',    {'content': 'Which invoices came in this week?'},) if turn['status'] == 'awaiting_approval':    for call in turn['pendingToolCalls']:        print('Waiting on', call['toolName'], call['args'])elif turn['messages']:    print(turn['messages'][-1]['text'])

Notes

  • While the assistant is still answering in the chat, a new message is 409 chat_busy, and while a tool call waits for an answer it is 409 approval_pending. A messageId already in the chat is 422 invalid_parameter on messageId.

  • An id that belongs to a task run, or regenerate in a chat with no message from you, is a 404.

  • Each turn spends the workspace's AI actions, and a workspace that has used them all for the day is refused with 429 ai_quota_exceeded before anything is saved. When AI is unavailable on the server it is 409 ai_not_configured, and when the assistant cannot be reached 503 assistant_unavailable, with nothing sent.

  • The SDK does not retry it, since a lost attempt may already have reached the assistant. Send a messageId to make a second attempt safe: a message the chat already holds is refused instead of said twice.

Also available in

API
POST /chats/{id}/messages
TypeScript
chats.sendMessage()
Ruby
chats.send_message
PHP
chats->sendMessage
Go
Chats.SendMessage
Java
chats().sendMessage
C#
Chats.SendMessageAsync

chats.stop_turn()

Stop the turn running in a chat

Scopesthreads:write
Signature
def stop_turn(    id: str,    body: ChatTurnStop | None = None,    *,    api_key: str | None = None,    timeout: float | None = None,) -> ChatTurnStopResource

Stops the assistant while it answers in the chat, in the app or through this API, and keeps what it had written. A tool call that had not returned is marked interrupted. Calling it when nothing runs is not an error: the answer is idle. Send turnId in the body to stop the turn only while it is that one.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

body['turnId']str

Stops the turn only while it is this one, as turnId of a chat turn names it. Left out, whatever runs in the chat is stopped.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds this call may take, the response included, before it raises NextmailNetworkError with is_timeout. It overrides the client's timeout for this call, and 0 turns the limit off.

Returns

ChatTurnStopResource, a dict with object set to chat_turn, chatId, turnId and status: stopped when a turn was running and has stopped, idle when nothing was running or another turn than turnId was. CHAT_STOP_STATUSES holds the values.

Example

from nextmail import nextmail stop = nextmail.chats.stop_turn('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65') print(stop['status'], stop['turnId'])

Notes

  • An unknown chat id is a 404. When the assistant cannot be reached it is 503 assistant_unavailable, and nothing was stopped.

  • The SDK does not retry it. A second call after a lost response answers idle, since the turn has already stopped.

Also available in

API
POST /chats/{id}/stop
TypeScript
chats.stopTurn()
Ruby
chats.stop_turn
PHP
chats->stopTurn
Go
Chats.StopTurn
Java
chats().stopTurn
C#
Chats.StopTurnAsync

chats.approve_tool_call()

Approve a tool call

Scopesthreads:write
Signature
def approve_tool_call(    id: str,    tool_call_id: str,    body: ChatToolCallApproval | None = None,    *,    api_key: str | None = None,    timeout: float | None = None,) -> ChatTurnResource

Lets the assistant make a call it asked to make, with the arguments the call shows and any args in the body laid over them, and returns once the assistant has carried on. When the turn waits for several calls, it carries on once every one is answered, so the answer to an earlier one still has status set to awaiting_approval, with the calls left in pendingToolCalls.

A call of a tool this key or app may not run in a chat, such as one asked for in the app that needs a scope the key does not hold, is refused with 403 tool_not_offered before anything runs, and it keeps waiting: deny it, or approve it in the app.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

tool_call_idstrRequired

The call, as toolCallId in pendingToolCalls of the last chat turn names it.

body['args']dict[str, Any]

Arguments to change before the call runs, as a dict laid over the ones the assistant chose. Left out, the call runs as asked.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds to wait for the assistant to answer, the response included, before it raises NextmailNetworkError with is_timeout. Left out, it is 300 seconds, or the client's timeout when that is longer, and no limit at all when the client's timeout is 0. 0 waits as long as it takes. A turn that is still running when the wait ends goes on in the chat, so call stop_turn to stop it.

Returns

ChatTurnResource, the turn once the assistant has carried on, with status, messages, pendingToolCalls and error.

Example

from nextmail import nextmail turn = nextmail.chats.send_message(    '8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65',    {'content': 'Archive the newsletters from last month'},) for call in turn['pendingToolCalls']:    following = nextmail.chats.approve_tool_call(turn['chatId'], call['toolCallId'])     print(following['status'])

Notes

  • No tool call with that id waiting for an answer is a 404. While the assistant is still answering it is 409 chat_busy, and when the assistant cannot be reached 503 assistant_unavailable.

  • The SDK does not retry it, since a lost attempt may already have run the tool. A second attempt after a lost response is 409 chat_busy while the assistant carries on, and a 404 once the call no longer waits.

Also available in

API
POST /chats/{id}/tool-calls/{toolCallId}/approve
TypeScript
chats.approveToolCall()
Ruby
chats.approve_tool_call
PHP
chats->approveToolCall
Go
Chats.ApproveToolCall
Java
chats().approveToolCall
C#
Chats.ApproveToolCallAsync

chats.deny_tool_call()

Deny a tool call

Scopesthreads:write
Signature
def deny_tool_call(    id: str,    tool_call_id: str,    *,    api_key: str | None = None,    timeout: float | None = None,) -> ChatTurnResource

Refuses a call the assistant asked to make. The assistant is told, and carries on without it once every call it waits for is answered, and the call returns once it has. Nothing the call described is done. It takes no body.

Each person reaches only their own chats: an API key reaches the chats of the workspace owner, and an access token reaches the chats of the person who connected it. A key or token limited to particular addresses or domains is 422 capability_unsupported.

Parameters

idstrRequired

The chat id from list.

tool_call_idstrRequired

The call, as toolCallId in pendingToolCalls of the last chat turn names it.

api_keystr

Overrides the client's API key for this call only.

timeoutfloat

Seconds to wait for the assistant to answer, the response included, before it raises NextmailNetworkError with is_timeout. Left out, it is 300 seconds, or the client's timeout when that is longer, and no limit at all when the client's timeout is 0. 0 waits as long as it takes. A turn that is still running when the wait ends goes on in the chat, so call stop_turn to stop it.

Returns

ChatTurnResource, the turn once the assistant has carried on, with the call marked denied in its messages.

Example

from nextmail import nextmail turn = nextmail.chats.deny_tool_call('8f3c2a71-5e9d-4b06-a1c4-7d2e9f0b3a65', 'call_7Hq2Xb9Lm4') print(turn['status'], turn['messages'][-1]['text'] if turn['messages'] else '')

Notes

  • No tool call with that id waiting for an answer is a 404. While the assistant is still answering it is 409 chat_busy, and when the assistant cannot be reached 503 assistant_unavailable.

  • The SDK does not retry it. A second attempt after a lost response is 409 chat_busy while the assistant carries on, and a 404 once the call no longer waits.

Also available in

API
POST /chats/{id}/tool-calls/{toolCallId}/deny
TypeScript
chats.denyToolCall()
Ruby
chats.deny_tool_call
PHP
chats->denyToolCall
Go
Chats.DenyToolCall
Java
chats().denyToolCall
C#
Chats.DenyToolCallAsync