Skip to main content

AgentDeliberation API

Agent Deliberation API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
addResponseAdds a response to a deliberation.
addVoteCasts a vote on a deliberation.
createCreates a new deliberation.
deleteDeletes a deliberation.
getRetrieves a specific deliberation by ID.
getAllRetrieves all deliberations.
getResponsesRetrieves all responses submitted to a deliberation.
getVotesRetrieves all votes cast in a deliberation.
getWinnerRetrieves the winning response of a deliberation.
startAgentsStarts agents for a deliberation.
startVotingAgentsStarts voting agents for a deliberation.
updatePartially updates a deliberation.
updateSummaryUpdates the summary of a deliberation.

Methods


addResponse

client.agentDeliberation.addResponse(id: string, data: AddDeliberationResponseRequest): Promise<DeliberationResponse>

Adds a response to a deliberation.

Submits a new proposal or answer from an agent as part of the deliberation process.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation
dataAddDeliberationResponseRequestYesThe response payload containing the agent's proposal

Returns: Promise<DeliberationResponse> — A promise that resolves to the created DeliberationResponse

Full reference →


addVote

client.agentDeliberation.addVote(id: string, data: AddDeliberationVoteRequest): Promise<DeliberationVote>

Casts a vote on a deliberation.

Records an agent's vote for a specific response within the deliberation.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation
dataAddDeliberationVoteRequestYesThe vote payload

Returns: Promise<DeliberationVote> — A promise that resolves to the recorded DeliberationVote

Full reference →


create

client.agentDeliberation.create(data: CreateDeliberationRequest): Promise<Deliberation>

Creates a new deliberation.

Initiates a deliberation session where multiple agents can propose solutions and vote on the best approach.

ParameterTypeRequiredDescription
dataCreateDeliberationRequestYesThe deliberation creation payload

Returns: Promise<Deliberation> — A promise that resolves to the newly created Deliberation

Full reference →


delete

client.agentDeliberation.delete(id: string): Promise<unknown>

Deletes a deliberation.

Permanently removes the specified deliberation and all its associated responses and votes.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation to delete

Returns: Promise<unknown> — A promise that resolves when the deliberation has been deleted

Full reference →


get

client.agentDeliberation.get(id: string): Promise<Deliberation>

Retrieves a specific deliberation by ID.

Returns the full deliberation record including its topic, status, participants, and summary.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation

Returns: Promise<Deliberation> — A promise that resolves to the Deliberation object

Full reference →


getAll

client.agentDeliberation.getAll(params?: Record<string, unknown>): Promise<Deliberation[]>

Retrieves all deliberations.

Returns every deliberation in the system, optionally filtered by the provided query parameters.

ParameterTypeRequiredDescription
paramsRecord<string, unknown>NoOptional query or filter parameters

Returns: Promise<Deliberation[]> — A promise that resolves to an array of Deliberation objects

Full reference →


getResponses

client.agentDeliberation.getResponses(id: string): Promise<DeliberationResponse[]>

Retrieves all responses submitted to a deliberation.

Returns the proposals or answers that agents have submitted as part of the deliberation process.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation

Returns: Promise<DeliberationResponse[]> — A promise that resolves to an array of DeliberationResponse objects

Full reference →


getVotes

client.agentDeliberation.getVotes(id: string): Promise<DeliberationVote[]>

Retrieves all votes cast in a deliberation.

Returns the voting records showing which agents voted for which responses.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation

Returns: Promise<DeliberationVote[]> — A promise that resolves to an array of DeliberationVote objects

Full reference →


getWinner

client.agentDeliberation.getWinner(id: string): Promise<DeliberationResponse>

Retrieves the winning response of a deliberation.

Returns the response that received the most votes or was otherwise selected as the winner of the deliberation process.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation

Returns: Promise<DeliberationResponse> — A promise that resolves to the winning DeliberationResponse

Full reference →


startAgents

client.agentDeliberation.startAgents(id: string, data?: StartDeliberationAgentsRequest): Promise<unknown>

Starts agents for a deliberation.

Launches the participant agents so they can begin generating responses for the deliberation topic.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation
dataStartDeliberationAgentsRequestNoOptional configuration for the agent startup

Returns: Promise<unknown> — A promise that resolves when the agents have been started

Full reference →


startVotingAgents

client.agentDeliberation.startVotingAgents(id: string, data?: StartVotingAgentsRequest): Promise<unknown>

Starts voting agents for a deliberation.

Launches the voting agents so they can evaluate the submitted responses and cast their votes.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation
dataStartVotingAgentsRequestNoOptional configuration for the voting agent startup

Returns: Promise<unknown> — A promise that resolves when the voting agents have been started

Full reference →


update

client.agentDeliberation.update(id: string, data: UpdateDeliberationRequest): Promise<Deliberation>

Partially updates a deliberation.

Applies a patch to the deliberation record, updating only the fields provided in the request.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation to update
dataUpdateDeliberationRequestYesThe fields to patch on the deliberation

Returns: Promise<Deliberation> — A promise that resolves to the updated Deliberation

Full reference →


updateSummary

client.agentDeliberation.updateSummary(id: string, data: UpdateDeliberationSummaryRequest): Promise<Deliberation>

Updates the summary of a deliberation.

Sets or modifies the summary text that describes the outcome or current state of the deliberation.

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the deliberation
dataUpdateDeliberationSummaryRequestYesThe summary update payload

Returns: Promise<Deliberation> — A promise that resolves to the updated Deliberation

Full reference →