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

Fix sdks #468

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
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
218 changes: 218 additions & 0 deletions sdks/ts/src/agents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
import {
Agents_CreateAgentRequest,
Common_uuid,
Agents_UpdateAgentRequest,
Common_limit,
Common_offset,
Agents_PatchAgentRequest,
Docs_VectorDocSearchRequest,
Docs_TextOnlyDocSearchRequest,
Docs_HybridDocSearchRequest,
Docs_CreateDocRequest,
Tools_PatchToolRequest,
Tools_UpdateToolRequest,
} from "./api";
import { BaseRoutes } from "./baseRoutes";

export class AgentsRoutes extends BaseRoutes {
async create({ requestBody }: { requestBody: Agents_CreateAgentRequest }) {
return await this.apiClient.default.agentsRouteCreate({ requestBody });
}

async createOrUpdate({
id,
requestBody,
}: {
id: Common_uuid;
requestBody: Agents_UpdateAgentRequest;
}) {
return await this.apiClient.default.agentsRouteCreateOrUpdate({
id,
requestBody,
});
}

async delete({ id }: { id: Common_uuid }) {
return await this.apiClient.default.agentsRouteDelete({ id });
}

async get({ id }: { id: Common_uuid }) {
return await this.apiClient.default.agentsRouteGet({ id });
}

async list({
limit = 100,
offset,
sortBy = "created_at",
direction = "asc",
metadataFilter = "{}",
}: {
limit?: Common_limit;
offset: Common_offset;
sortBy?: "created_at" | "updated_at";
direction?: "asc" | "desc";
metadataFilter?: string;
}) {
return await this.apiClient.default.agentsRouteList({
limit,
offset,
sortBy,
direction,
metadataFilter,
});
}

async patch({
id,
requestBody,
}: {
id: Common_uuid;
requestBody: Agents_PatchAgentRequest;
}) {
return await this.apiClient.default.agentsRoutePatch({ id, requestBody });
}

async update({
id,
requestBody,
}: {
id: Common_uuid;
requestBody: Agents_UpdateAgentRequest;
}) {
return await this.apiClient.default.agentsRouteUpdate({ id, requestBody });
}

async searchDocs({
id,
requestBody,
}: {
id: Common_uuid;
requestBody: {
body:
| Docs_VectorDocSearchRequest
| Docs_TextOnlyDocSearchRequest
| Docs_HybridDocSearchRequest;
};
}) {
return await this.apiClient.default.agentsDocsSearchRouteSearch({
id,
requestBody,
});
}

async createDoc({
id,
requestBody,
}: {
id: Common_uuid;
requestBody: Docs_CreateDocRequest;
}) {
return await this.apiClient.default.agentDocsRouteCreate({
id,
requestBody,
});
}

async listDocs({
id,
limit = 100,
offset,
sortBy = "created_at",
direction = "asc",
metadataFilter = "{}",
}: {
id: Common_uuid;
limit?: Common_limit;
offset: Common_offset;
sortBy?: "created_at" | "updated_at";
direction?: "asc" | "desc";
metadataFilter?: string;
}) {
return await this.apiClient.default.agentDocsRouteList({
id,
limit,
offset,
sortBy,
direction,
metadataFilter,
});
}

async createTool({
id,
requestBody,
}: {
id: Common_uuid;
requestBody: Agents_CreateAgentRequest;
}) {
return await this.apiClient.default.agentToolsRouteCreate({
id,
requestBody,
});
}

async deleteTool({ id, childId }: { id: Common_uuid; childId: Common_uuid }) {
return await this.apiClient.default.agentToolsRouteDelete({ id, childId });
}

async listTools({
id,
limit = 100,
offset,
sortBy = "created_at",
direction = "asc",
metadataFilter = "{}",
}: {
id: Common_uuid;
limit?: Common_limit;
offset: Common_offset;
sortBy?: "created_at" | "updated_at";
direction?: "asc" | "desc";
metadataFilter?: string;
}) {
return await this.apiClient.default.agentToolsRouteList({
id,
limit,
offset,
sortBy,
direction,
metadataFilter,
});
}

async patchTool({
id,
childId,
requestBody,
}: {
id: Common_uuid;
childId: Common_uuid;
requestBody: Tools_PatchToolRequest;
}) {
return await this.apiClient.default.agentToolsRoutePatch({
id,
childId,
requestBody,
});
}

async updateTool({
id,
childId,
requestBody,
}: {
id: Common_uuid;
childId: Common_uuid;
requestBody: Tools_UpdateToolRequest;
}) {
return await this.apiClient.default.agentToolsRouteUpdate({
id,
childId,
requestBody,
});
}

async deleteDoc({ id, childId }: { id: Common_uuid; childId: Common_uuid }) {
return await this.apiClient.default.agentDocsRouteDelete({ id, childId });
}
}
8 changes: 0 additions & 8 deletions sdks/ts/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,17 @@ export type { Tasks_UpdateTaskRequest } from "./models/Tasks_UpdateTaskRequest";
export type { Tasks_WaitForInputInfo } from "./models/Tasks_WaitForInputInfo";
export type { Tasks_WaitForInputStep } from "./models/Tasks_WaitForInputStep";
export type { Tasks_YieldStep } from "./models/Tasks_YieldStep";
export type { Tools_ChosenFunctionCall } from "./models/Tools_ChosenFunctionCall";
export type { Tools_ChosenToolCall } from "./models/Tools_ChosenToolCall";
export type { Tools_CreateToolRequest } from "./models/Tools_CreateToolRequest";
export type { Tools_FunctionCallOption } from "./models/Tools_FunctionCallOption";
export type { Tools_FunctionDef } from "./models/Tools_FunctionDef";
export type { Tools_FunctionTool } from "./models/Tools_FunctionTool";
export type { Tools_NamedFunctionChoice } from "./models/Tools_NamedFunctionChoice";
export type { Tools_NamedToolChoice } from "./models/Tools_NamedToolChoice";
export type { Tools_PatchToolRequest } from "./models/Tools_PatchToolRequest";
export type { Tools_Tool } from "./models/Tools_Tool";
export type { Tools_ToolResponse } from "./models/Tools_ToolResponse";
export type { Tools_ToolType } from "./models/Tools_ToolType";
export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest";
export type { Users_CreateOrUpdateUserRequest } from "./models/Users_CreateOrUpdateUserRequest";
export type { Users_CreateOrUpdateUserRequest } from "./models/Users_CreateOrUpdateUserRequest";
export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest";
export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest";
export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest";
Expand Down Expand Up @@ -250,21 +246,17 @@ export { $Tasks_UpdateTaskRequest } from "./schemas/$Tasks_UpdateTaskRequest";
export { $Tasks_WaitForInputInfo } from "./schemas/$Tasks_WaitForInputInfo";
export { $Tasks_WaitForInputStep } from "./schemas/$Tasks_WaitForInputStep";
export { $Tasks_YieldStep } from "./schemas/$Tasks_YieldStep";
export { $Tools_ChosenFunctionCall } from "./schemas/$Tools_ChosenFunctionCall";
export { $Tools_ChosenToolCall } from "./schemas/$Tools_ChosenToolCall";
export { $Tools_CreateToolRequest } from "./schemas/$Tools_CreateToolRequest";
export { $Tools_FunctionCallOption } from "./schemas/$Tools_FunctionCallOption";
export { $Tools_FunctionDef } from "./schemas/$Tools_FunctionDef";
export { $Tools_FunctionTool } from "./schemas/$Tools_FunctionTool";
export { $Tools_NamedFunctionChoice } from "./schemas/$Tools_NamedFunctionChoice";
export { $Tools_NamedToolChoice } from "./schemas/$Tools_NamedToolChoice";
export { $Tools_PatchToolRequest } from "./schemas/$Tools_PatchToolRequest";
export { $Tools_Tool } from "./schemas/$Tools_Tool";
export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse";
export { $Tools_ToolType } from "./schemas/$Tools_ToolType";
export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest";
export { $Users_CreateOrUpdateUserRequest } from "./schemas/$Users_CreateOrUpdateUserRequest";
export { $Users_CreateOrUpdateUserRequest } from "./schemas/$Users_CreateOrUpdateUserRequest";
export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest";
export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest";
export { $Users_UpdateUserRequest } from "./schemas/$Users_UpdateUserRequest";
Expand Down
4 changes: 2 additions & 2 deletions sdks/ts/src/api/models/Chat_ChatInputData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* tslint:disable */
/* eslint-disable */
import type { Entries_ChatMLRole } from "./Entries_ChatMLRole";
import type { Tools_FunctionTool } from "./Tools_FunctionTool";
import type { Tools_NamedToolChoice } from "./Tools_NamedToolChoice";
import type { Tools_Tool } from "./Tools_Tool";
export type Chat_ChatInputData = {
/**
* A list of new input messages comprising the conversation so far.
Expand All @@ -30,7 +30,7 @@ export type Chat_ChatInputData = {
/**
* (Advanced) List of tools that are provided in addition to agent's default set of tools.
*/
tools?: Array<Tools_FunctionTool>;
tools?: Array<Tools_Tool>;
/**
* Can be one of existing tools given to the agent earlier or the ones provided in this request.
*/
Expand Down
14 changes: 0 additions & 14 deletions sdks/ts/src/api/models/Tools_ChosenFunctionCall.ts

This file was deleted.

6 changes: 5 additions & 1 deletion sdks/ts/src/api/models/Tools_CreateToolRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export type Tools_CreateToolRequest = {
* Name of the tool (must be unique for this agent and a valid python identifier string )
*/
name: Common_validPythonIdentifier;
function?: Tools_FunctionDef;
background: boolean;
/**
* The function to call
*/
function: Tools_FunctionDef;
integration?: any;
system?: any;
api_call?: any;
Expand Down
15 changes: 0 additions & 15 deletions sdks/ts/src/api/models/Tools_FunctionTool.ts

This file was deleted.

14 changes: 0 additions & 14 deletions sdks/ts/src/api/models/Tools_NamedFunctionChoice.ts

This file was deleted.

4 changes: 4 additions & 0 deletions sdks/ts/src/api/models/Tools_PatchToolRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export type Tools_PatchToolRequest = {
* Name of the tool (must be unique for this agent and a valid python identifier string )
*/
name?: Common_validPythonIdentifier;
background?: boolean;
/**
* The function to call
*/
function?: Tools_FunctionDef;
integration?: any;
system?: any;
Expand Down
6 changes: 5 additions & 1 deletion sdks/ts/src/api/models/Tools_Tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export type Tools_Tool = {
* Name of the tool (must be unique for this agent and a valid python identifier string )
*/
name: Common_validPythonIdentifier;
function?: Tools_FunctionDef;
background: boolean;
/**
* The function to call
*/
function: Tools_FunctionDef;
integration?: any;
system?: any;
api_call?: any;
Expand Down
6 changes: 5 additions & 1 deletion sdks/ts/src/api/models/Tools_UpdateToolRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export type Tools_UpdateToolRequest = {
* Name of the tool (must be unique for this agent and a valid python identifier string )
*/
name: Common_validPythonIdentifier;
function?: Tools_FunctionDef;
background: boolean;
/**
* The function to call
*/
function: Tools_FunctionDef;
integration?: any;
system?: any;
api_call?: any;
Expand Down
2 changes: 1 addition & 1 deletion sdks/ts/src/api/schemas/$Chat_ChatInputData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const $Chat_ChatInputData = {
tools: {
type: "array",
contains: {
type: "Tools_FunctionTool",
type: "Tools_Tool",
},
},
tool_choice: {
Expand Down
Loading