Skip to content

Commit

Permalink
feat: Updated sdks/ts/src/managers/agent.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Apr 18, 2024
1 parent 79eae2d commit ad5efd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdks/ts/src/managers/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export class AgentsManager extends BaseManager {
model?: string;
docs?: Doc[];
}): Promise<Partial<Agent> & { id: string }> {
// FIXME: Fix the type of return value
// The returned object must have an `id` (cannot be `undefined`)
// Ensure the returned object includes an `id` property of type string, which is guaranteed not to be `undefined`

const requestBody: CreateAgentRequest = {
name,
Expand Down Expand Up @@ -89,6 +88,7 @@ export class AgentsManager extends BaseManager {
await this.apiClient.default.deleteAgent({ agentId });
}

// Overloads for the `update` function to handle both partial updates (patch) and full updates (overwrite) of an agent.
async update(
agentId: string,
request: PatchAgentRequest,
Expand Down Expand Up @@ -117,6 +117,7 @@ export class AgentsManager extends BaseManager {
// Fails tests
// const updateFn = overwrite ? this.apiClient.default.updateAgent : this.apiClient.default.patchAgent;

// If `overwrite` is true, perform a full update of the agent using the provided details. Otherwise, perform a partial update (patch).
if (overwrite) {
const requestBody: UpdateAgentRequest = {
about: about!,
Expand Down

0 comments on commit ad5efd1

Please sign in to comment.