Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Update the docstrings and comments in sdks/ts/src/managers/tool.ts to fix any issues and mismatch between the comment and associated code #239

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdks/ts/src/managers/tool.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ToolsManager class manages tool-related operations such as listing, creating, updating, and deleting tools.
import {
Tool,
UpdateToolRequest,
Expand All @@ -18,6 +19,7 @@ export class ToolsManager extends BaseManager {
offset?: number;
} = {},
): Promise<Array<Tool>> {
// Lists tools associated with a given agent. Allows pagination through `limit` and `offset` parameters.
const result = await this.apiClient.default.getAgentTools({
agentId,
limit,
Expand All @@ -37,6 +39,7 @@ export class ToolsManager extends BaseManager {
function: FunctionDef;
};
}): Promise<Tool> {
// Creates a new tool for the specified agent. The `tool` parameter must include the tool type and function definition.
const result: ResourceCreatedResponse =
await this.apiClient.default.createAgentTool({
agentId,
Expand All @@ -60,6 +63,7 @@ export class ToolsManager extends BaseManager {
},
overwrite = false,
): Promise<Tool> {
// Updates an existing tool. If `overwrite` is true, it replaces the existing tool with the new one; otherwise, it patches the tool with the provided changes.
if (overwrite) {
const result = await this.apiClient.default.updateAgentTool({
agentId,
Expand All @@ -86,6 +90,7 @@ export class ToolsManager extends BaseManager {
agentId: string;
toolId: string;
}): Promise<void> {
// Deletes a specified tool from an agent.
await this.apiClient.default.deleteAgentTool({ agentId, toolId });
}
}
Loading