From bb8086b56baa23012d455f05f5a903619c668990 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 18 Apr 2024 22:01:54 +0800 Subject: [PATCH] docs: update SUMMARY.md --- docs/SUMMARY.md | 31 +- docs/sdks/available-sdks.md | 9 - docs/sdks/js-sdk-docs/README.md | 1 - .../js-sdk-docs/client.julepapiclient-1.md | 982 ---------- docs/sdks/js-sdk-docs/modules.md | 13 - docs/sdks/python-sdk-docs/README.md | 77 - docs/sdks/python-sdk-docs/agent.md | 646 ------- docs/sdks/python-sdk-docs/client-1.md | 1716 ----------------- docs/sdks/python-sdk-docs/client.md | 87 - docs/sdks/python-sdk-docs/doc.md | 429 ----- docs/sdks/python-sdk-docs/memory.md | 190 -- docs/sdks/python-sdk-docs/session.md | 958 --------- docs/sdks/python-sdk-docs/tool.md | 450 ----- docs/sdks/python-sdk-docs/user.md | 518 ----- 14 files changed, 18 insertions(+), 6089 deletions(-) delete mode 100644 docs/sdks/available-sdks.md delete mode 100644 docs/sdks/js-sdk-docs/README.md delete mode 100644 docs/sdks/js-sdk-docs/client.julepapiclient-1.md delete mode 100644 docs/sdks/js-sdk-docs/modules.md delete mode 100644 docs/sdks/python-sdk-docs/README.md delete mode 100644 docs/sdks/python-sdk-docs/agent.md delete mode 100644 docs/sdks/python-sdk-docs/client-1.md delete mode 100644 docs/sdks/python-sdk-docs/client.md delete mode 100644 docs/sdks/python-sdk-docs/doc.md delete mode 100644 docs/sdks/python-sdk-docs/memory.md delete mode 100644 docs/sdks/python-sdk-docs/session.md delete mode 100644 docs/sdks/python-sdk-docs/tool.md delete mode 100644 docs/sdks/python-sdk-docs/user.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 4c3f0c422..7cface841 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -34,19 +34,24 @@ ## 🛠️ SDKs -* [Available SDKs](sdks/available-sdks.md) -* [Python SDK](sdks/python-sdk-docs/README.md) - * [Client](sdks/python-sdk-docs/client.md) - * [Agents](sdks/python-sdk-docs/agent.md) - * [Users](sdks/python-sdk-docs/user.md) - * [Sessions](sdks/python-sdk-docs/session.md) - * [Memories](sdks/python-sdk-docs/memory.md) - * [Docs](sdks/python-sdk-docs/doc.md) - * [Tools](sdks/python-sdk-docs/tool.md) - * [API](sdks/python-sdk-docs/client-1.md) -* [JS SDK](sdks/js-sdk-docs/README.md) - * [Client](sdks/js-sdk-docs/client.julepapiclient-1.md) - * [Modules](sdks/js-sdk-docs/modules.md) +* [Python SDK](python-sdk-docs/README.md) + * [Client](python-sdk-docs/julep/client.md) + * [Agents](python-sdk-docs/julep/managers/agent.md) + * [Users](python-sdk-docs/julep/managers/user.md) + * [Sessions](python-sdk-docs/julep/managers/session.md) + * [Memories](python-sdk-docs/julep/managers/memory.md) + * [Docs](python-sdk-docs/julep/managers/doc.md) + * [Tools](python-sdk-docs/julep/managers/tool.md) + * [API](python-sdk-docs/julep/api/client.md) +* [JS SDK](js-sdk-docs/README.md) + * [API](js-sdk-docs/modules/api.md) + * [Client](js-sdk-docs/classes/api_JulepApiClient.JulepApiClient.md) + * [Agent](js-sdk-docs/classes/managers_agent.AgentsManager.md) + * [Doc](js-sdk-docs/classes/managers_doc.DocsManager.md) + * [Memory](js-sdk-docs/classes/managers_memory.MemoriesManager.md) + * [Session](js-sdk-docs/classes/managers_session.SessionsManager.md) + * [Tool](js-sdk-docs/classes/managers_tool.ToolsManager.md) + * [User](js-sdk-docs/classes/managers_user.UsersManager.md) ## 📖 API REFERENCE diff --git a/docs/sdks/available-sdks.md b/docs/sdks/available-sdks.md deleted file mode 100644 index ef8e80731..000000000 --- a/docs/sdks/available-sdks.md +++ /dev/null @@ -1,9 +0,0 @@ -# Available SDKs - -We have SDKs for interacting with our APIs in various languages: - -* [Python](python-sdk-docs/) -* [Javascript / Typescript](js-sdk-docs/) -* Go (coming soon) -* Ruby (coming soon) -* Java (coming soon) diff --git a/docs/sdks/js-sdk-docs/README.md b/docs/sdks/js-sdk-docs/README.md deleted file mode 100644 index ed88b6d0f..000000000 --- a/docs/sdks/js-sdk-docs/README.md +++ /dev/null @@ -1 +0,0 @@ -@julep/sdk / [Modules](modules.md) diff --git a/docs/sdks/js-sdk-docs/client.julepapiclient-1.md b/docs/sdks/js-sdk-docs/client.julepapiclient-1.md deleted file mode 100644 index 891f65cde..000000000 --- a/docs/sdks/js-sdk-docs/client.julepapiclient-1.md +++ /dev/null @@ -1,982 +0,0 @@ -# Client - -[@julep/sdk](./) / [Modules](modules.md) / [Client](../../js-sdk-docs/modules/Client.md) / JulepApiClient - -## Class: JulepApiClient - -[Client](../../js-sdk-docs/modules/Client.md).JulepApiClient - -### Table of contents - -#### Constructors - -* [constructor](client.julepapiclient-1.md#constructor) - -#### Properties - -* [\_options](client.julepapiclient-1.md#\_options) - -#### Methods - -* [\_getAuthorizationHeader](client.julepapiclient-1.md#\_getauthorizationheader) -* [chat](client.julepapiclient-1.md#chat) -* [createAgent](client.julepapiclient-1.md#createagent) -* [createAgentDoc](client.julepapiclient-1.md#createagentdoc) -* [createAgentTool](client.julepapiclient-1.md#createagenttool) -* [createSession](client.julepapiclient-1.md#createsession) -* [createUser](client.julepapiclient-1.md#createuser) -* [createUserDoc](client.julepapiclient-1.md#createuserdoc) -* [deleteAgent](client.julepapiclient-1.md#deleteagent) -* [deleteAgentDoc](client.julepapiclient-1.md#deleteagentdoc) -* [deleteAgentMemory](client.julepapiclient-1.md#deleteagentmemory) -* [deleteAgentTool](client.julepapiclient-1.md#deleteagenttool) -* [deleteSession](client.julepapiclient-1.md#deletesession) -* [deleteUser](client.julepapiclient-1.md#deleteuser) -* [deleteUserDoc](client.julepapiclient-1.md#deleteuserdoc) -* [getAgent](client.julepapiclient-1.md#getagent) -* [getAgentDocs](client.julepapiclient-1.md#getagentdocs) -* [getAgentMemories](client.julepapiclient-1.md#getagentmemories) -* [getAgentTools](client.julepapiclient-1.md#getagenttools) -* [getHistory](client.julepapiclient-1.md#gethistory) -* [getSession](client.julepapiclient-1.md#getsession) -* [getSuggestions](client.julepapiclient-1.md#getsuggestions) -* [getUser](client.julepapiclient-1.md#getuser) -* [getUserDocs](client.julepapiclient-1.md#getuserdocs) -* [listAgents](client.julepapiclient-1.md#listagents) -* [listSessions](client.julepapiclient-1.md#listsessions) -* [listUsers](client.julepapiclient-1.md#listusers) -* [updateAgent](client.julepapiclient-1.md#updateagent) -* [updateAgentTool](client.julepapiclient-1.md#updateagenttool) -* [updateSession](client.julepapiclient-1.md#updatesession) -* [updateUser](client.julepapiclient-1.md#updateuser) - -### Constructors - -#### constructor - -• **new JulepApiClient**(`_options`): [`JulepApiClient`](client.julepapiclient-1.md) - -**Parameters** - -| Name | Type | -| ---------- | -------------------------------------------------------------------------- | -| `_options` | [`Options`](../../js-sdk-docs/interfaces/Client.JulepApiClient.Options.md) | - -**Returns** - -[`JulepApiClient`](client.julepapiclient-1.md) - -**Defined in** - -[src/api/Client.d.ts:19](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L19) - -### Properties - -#### \_options - -• `Protected` `Readonly` **\_options**: [`Options`](../../js-sdk-docs/interfaces/Client.JulepApiClient.Options.md) - -**Defined in** - -[src/api/Client.d.ts:18](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L18) - -### Methods - -#### \_getAuthorizationHeader - -▸ **\_getAuthorizationHeader**(): `Promise`<`string`> - -**Returns** - -`Promise`<`string`> - -**Defined in** - -[src/api/Client.d.ts:373](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L373) - -*** - -#### chat - -▸ **chat**(`sessionId`, `request`, `requestOptions?`): `Promise`<[`ChatResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ChatResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `sessionId` | `string` | -| `request` | [`ChatInput`](../../js-sdk-docs/interfaces/index.JulepApi.ChatInput.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ChatResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ChatResponse.md)> - -**`Example`** - -```ts -await julepApi.chat("session_id", { - accept: "application/json", - messages: [{ - role: JulepApi.InputChatMlMessageRole.User, - content: "content" - }] - }) -``` - -**Defined in** - -[src/api/Client.d.ts:154](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L154) - -*** - -#### createAgent - -▸ **createAgent**(`request`, `requestOptions?`): `Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -Create a new agent - -**Parameters** - -| Name | Type | -| ----------------- | ----------------------------------------------------------------------------------------- | -| `request` | [`CreateAgentRequest`](../../js-sdk-docs/interfaces/index.JulepApi.CreateAgentRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**`Example`** - -```ts -await julepApi.createAgent({ - name: "name", - about: "about", - model: "model" - }) -``` - -**Defined in** - -[src/api/Client.d.ts:83](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L83) - -*** - -#### createAgentDoc - -▸ **createAgentDoc**(`agentId`, `request`, `requestOptions?`): `Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `request` | [`CreateDoc`](../../js-sdk-docs/interfaces/index.JulepApi.CreateDoc.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**`Example`** - -```ts -await julepApi.createAgentDoc("agent_id", { - title: "title", - content: "content" - }) -``` - -**Defined in** - -[src/api/Client.d.ts:254](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L254) - -*** - -#### createAgentTool - -▸ **createAgentTool**(`agentId`, `request`, `requestOptions?`): `Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `request` | [`CreateToolRequest`](../../js-sdk-docs/interfaces/index.JulepApi.CreateToolRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**`Example`** - -```ts -await julepApi.createAgentTool("agent_id", { - type: JulepApi.CreateToolRequestType.Function, - function: { - name: "name", - parameters: {} - } - }) -``` - -**Defined in** - -[src/api/Client.d.ts:340](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L340) - -*** - -#### createSession - -▸ **createSession**(`request`, `requestOptions?`): `Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -Create a session between an agent and a user - -**Parameters** - -| Name | Type | -| ----------------- | --------------------------------------------------------------------------------------------- | -| `request` | [`CreateSessionRequest`](../../js-sdk-docs/interfaces/index.JulepApi.CreateSessionRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**`Example`** - -```ts -await julepApi.createSession({ - userId: "user_id", - agentId: "agent_id" - }) -``` - -**Defined in** - -[src/api/Client.d.ts:39](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L39) - -*** - -#### createUser - -▸ **createUser**(`request?`, `requestOptions?`): `Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -Create a new user - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `request?` | [`CreateUserRequest`](../../js-sdk-docs/interfaces/index.JulepApi.CreateUserRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**`Example`** - -```ts -await julepApi.createUser({}) -``` - -**Defined in** - -[src/api/Client.d.ts:59](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L59) - -*** - -#### createUserDoc - -▸ **createUserDoc**(`userId`, `request`, `requestOptions?`): `Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `userId` | `string` | -| `request` | [`CreateDoc`](../../js-sdk-docs/interfaces/index.JulepApi.CreateDoc.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceCreatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceCreatedResponse.md)> - -**`Example`** - -```ts -await julepApi.createUserDoc("user_id", { - title: "title", - content: "content" - }) -``` - -**Defined in** - -[src/api/Client.d.ts:279](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L279) - -*** - -#### deleteAgent - -▸ **deleteAgent**(`agentId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteAgent("agent_id") -``` - -**Defined in** - -[src/api/Client.d.ts:230](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L230) - -*** - -#### deleteAgentDoc - -▸ **deleteAgentDoc**(`agentId`, `docId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `docId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteAgentDoc("agent_id", "doc_id") -``` - -**Defined in** - -[src/api/Client.d.ts:301](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L301) - -*** - -#### deleteAgentMemory - -▸ **deleteAgentMemory**(`agentId`, `memoryId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `memoryId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteAgentMemory("agent_id", "memory_id") -``` - -**Defined in** - -[src/api/Client.d.ts:312](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L312) - -*** - -#### deleteAgentTool - -▸ **deleteAgentTool**(`agentId`, `toolId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `toolId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteAgentTool("agent_id", "tool_id") -``` - -**Defined in** - -[src/api/Client.d.ts:368](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L368) - -*** - -#### deleteSession - -▸ **deleteSession**(`sessionId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `sessionId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteSession("session_id") -``` - -**Defined in** - -[src/api/Client.d.ts:116](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L116) - -*** - -#### deleteUser - -▸ **deleteUser**(`userId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `userId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteUser("user_id") -``` - -**Defined in** - -[src/api/Client.d.ts:199](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L199) - -*** - -#### deleteUserDoc - -▸ **deleteUserDoc**(`userId`, `docId`, `requestOptions?`): `Promise`<`void`> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `userId` | `string` | -| `docId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<`void`> - -**`Example`** - -```ts -await julepApi.deleteUserDoc("user_id", "doc_id") -``` - -**Defined in** - -[src/api/Client.d.ts:290](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L290) - -*** - -#### getAgent - -▸ **getAgent**(`agentId`, `requestOptions?`): `Promise`<[`Agent`](../../js-sdk-docs/interfaces/index.JulepApi.Agent.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`Agent`](../../js-sdk-docs/interfaces/index.JulepApi.Agent.md)> - -**`Example`** - -```ts -await julepApi.getAgent("agent_id") -``` - -**Defined in** - -[src/api/Client.d.ts:209](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L209) - -*** - -#### getAgentDocs - -▸ **getAgentDocs**(`agentId`, `request?`, `requestOptions?`): `Promise`<[`GetAgentDocsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentDocsResponse.md)> - -Sorted (created\_at descending) - -**Parameters** - -| Name | Type | -| ----------------- | ------------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `request?` | [`GetAgentDocsRequest`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentDocsRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`GetAgentDocsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentDocsResponse.md)> - -**`Example`** - -```ts -await julepApi.getAgentDocs("agent_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:240](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L240) - -*** - -#### getAgentMemories - -▸ **getAgentMemories**(`agentId`, `request`, `requestOptions?`): `Promise`<[`GetAgentMemoriesResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentMemoriesResponse.md)> - -Sorted (created\_at descending) - -**Parameters** - -| Name | Type | -| ----------------- | --------------------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `request` | [`GetAgentMemoriesRequest`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentMemoriesRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`GetAgentMemoriesResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentMemoriesResponse.md)> - -**`Example`** - -```ts -await julepApi.getAgentMemories("agent_id", { - query: "query" - }) -``` - -**Defined in** - -[src/api/Client.d.ts:167](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L167) - -*** - -#### getAgentTools - -▸ **getAgentTools**(`agentId`, `request?`, `requestOptions?`): `Promise`<[`GetAgentToolsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentToolsResponse.md)> - -Sorted (created\_at descending) - -**Parameters** - -| Name | Type | -| ----------------- | --------------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `request?` | [`GetAgentToolsRequest`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentToolsRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`GetAgentToolsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetAgentToolsResponse.md)> - -**`Example`** - -```ts -await julepApi.getAgentTools("agent_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:323](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L323) - -*** - -#### getHistory - -▸ **getHistory**(`sessionId`, `request?`, `requestOptions?`): `Promise`<[`GetHistoryResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetHistoryResponse.md)> - -Sorted (created\_at ascending) - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `sessionId` | `string` | -| `request?` | [`GetHistoryRequest`](../../js-sdk-docs/interfaces/index.JulepApi.GetHistoryRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`GetHistoryResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetHistoryResponse.md)> - -**`Example`** - -```ts -await julepApi.getHistory("session_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:137](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L137) - -*** - -#### getSession - -▸ **getSession**(`sessionId`, `requestOptions?`): `Promise`<[`Session`](../../js-sdk-docs/interfaces/index.JulepApi.Session.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `sessionId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`Session`](../../js-sdk-docs/interfaces/index.JulepApi.Session.md)> - -**`Example`** - -```ts -await julepApi.getSession("session_id") -``` - -**Defined in** - -[src/api/Client.d.ts:93](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L93) - -*** - -#### getSuggestions - -▸ **getSuggestions**(`sessionId`, `request?`, `requestOptions?`): `Promise`<[`GetSuggestionsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetSuggestionsResponse.md)> - -Sorted (created\_at descending) - -**Parameters** - -| Name | Type | -| ----------------- | ----------------------------------------------------------------------------------------------- | -| `sessionId` | `string` | -| `request?` | [`GetSuggestionsRequest`](../../js-sdk-docs/interfaces/index.JulepApi.GetSuggestionsRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`GetSuggestionsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetSuggestionsResponse.md)> - -**`Example`** - -```ts -await julepApi.getSuggestions("session_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:126](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L126) - -*** - -#### getUser - -▸ **getUser**(`userId`, `requestOptions?`): `Promise`<[`User`](../../js-sdk-docs/interfaces/index.JulepApi.User.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `userId` | `string` | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`User`](../../js-sdk-docs/interfaces/index.JulepApi.User.md)> - -**`Example`** - -```ts -await julepApi.getUser("user_id") -``` - -**Defined in** - -[src/api/Client.d.ts:178](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L178) - -*** - -#### getUserDocs - -▸ **getUserDocs**(`userId`, `request?`, `requestOptions?`): `Promise`<[`GetUserDocsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetUserDocsResponse.md)> - -Sorted (created\_at descending) - -**Parameters** - -| Name | Type | -| ----------------- | ----------------------------------------------------------------------------------------- | -| `userId` | `string` | -| `request?` | [`GetUserDocsRequest`](../../js-sdk-docs/interfaces/index.JulepApi.GetUserDocsRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`GetUserDocsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.GetUserDocsResponse.md)> - -**`Example`** - -```ts -await julepApi.getUserDocs("user_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:265](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L265) - -*** - -#### listAgents - -▸ **listAgents**(`request?`, `requestOptions?`): `Promise`<[`ListAgentsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ListAgentsResponse.md)> - -List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `request?` | [`ListAgentsRequest`](../../js-sdk-docs/interfaces/index.JulepApi.ListAgentsRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ListAgentsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ListAgentsResponse.md)> - -**`Example`** - -```ts -await julepApi.listAgents({}) -``` - -**Defined in** - -[src/api/Client.d.ts:69](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L69) - -*** - -#### listSessions - -▸ **listSessions**(`request?`, `requestOptions?`): `Promise`<[`ListSessionsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ListSessionsResponse.md)> - -List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -**Parameters** - -| Name | Type | -| ----------------- | ------------------------------------------------------------------------------------------- | -| `request?` | [`ListSessionsRequest`](../../js-sdk-docs/interfaces/index.JulepApi.ListSessionsRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ListSessionsResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ListSessionsResponse.md)> - -**`Example`** - -```ts -await julepApi.listSessions({}) -``` - -**Defined in** - -[src/api/Client.d.ts:26](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L26) - -*** - -#### listUsers - -▸ **listUsers**(`request?`, `requestOptions?`): `Promise`<[`ListUsersResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ListUsersResponse.md)> - -List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `request?` | [`ListUsersRequest`](../../js-sdk-docs/interfaces/index.JulepApi.ListUsersRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ListUsersResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ListUsersResponse.md)> - -**`Example`** - -```ts -await julepApi.listUsers({}) -``` - -**Defined in** - -[src/api/Client.d.ts:49](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L49) - -*** - -#### updateAgent - -▸ **updateAgent**(`agentId`, `request?`, `requestOptions?`): `Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ----------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `request?` | [`UpdateAgentRequest`](../../js-sdk-docs/interfaces/index.JulepApi.UpdateAgentRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**`Example`** - -```ts -await julepApi.updateAgent("agent_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:219](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L219) - -*** - -#### updateAgentTool - -▸ **updateAgentTool**(`agentId`, `toolId`, `request`, `requestOptions?`): `Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `agentId` | `string` | -| `toolId` | `string` | -| `request` | [`UpdateToolRequest`](../../js-sdk-docs/interfaces/index.JulepApi.UpdateToolRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**`Example`** - -```ts -await julepApi.updateAgentTool("agent_id", "tool_id", { - function: { - name: "name", - parameters: {} - } - }) -``` - -**Defined in** - -[src/api/Client.d.ts:356](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L356) - -*** - -#### updateSession - -▸ **updateSession**(`sessionId`, `request`, `requestOptions?`): `Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | --------------------------------------------------------------------------------------------- | -| `sessionId` | `string` | -| `request` | [`UpdateSessionRequest`](../../js-sdk-docs/interfaces/index.JulepApi.UpdateSessionRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**`Example`** - -```ts -await julepApi.updateSession("session_id", { - situation: "situation" - }) -``` - -**Defined in** - -[src/api/Client.d.ts:105](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L105) - -*** - -#### updateUser - -▸ **updateUser**(`userId`, `request?`, `requestOptions?`): `Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**Parameters** - -| Name | Type | -| ----------------- | ---------------------------------------------------------------------------------------- | -| `userId` | `string` | -| `request?` | [`UpdateUserRequest`](../../js-sdk-docs/interfaces/index.JulepApi.UpdateUserRequest.md) | -| `requestOptions?` | [`RequestOptions`](../../js-sdk-docs/interfaces/Client.JulepApiClient.RequestOptions.md) | - -**Returns** - -`Promise`<[`ResourceUpdatedResponse`](../../js-sdk-docs/interfaces/index.JulepApi.ResourceUpdatedResponse.md)> - -**`Example`** - -```ts -await julepApi.updateUser("user_id", {}) -``` - -**Defined in** - -[src/api/Client.d.ts:188](https://github.com/julep-ai/samantha-dev/blob/4200383/sdks/js/src/api/Client.d.ts#L188) diff --git a/docs/sdks/js-sdk-docs/modules.md b/docs/sdks/js-sdk-docs/modules.md deleted file mode 100644 index c041756ec..000000000 --- a/docs/sdks/js-sdk-docs/modules.md +++ /dev/null @@ -1,13 +0,0 @@ -# Modules - -[@julep/sdk](./) / Modules - -## @julep/sdk - -### Table of contents - -#### Modules - -* [Client](../../js-sdk-docs/modules/Client.md) -* [environments](../../js-sdk-docs/modules/environments.md) -* [index](../../js-sdk-docs/modules/index.md) diff --git a/docs/sdks/python-sdk-docs/README.md b/docs/sdks/python-sdk-docs/README.md deleted file mode 100644 index c63b7646e..000000000 --- a/docs/sdks/python-sdk-docs/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# Python SDK - -> Auto-generated documentation index. - -A full list of `Julep Python SDK` project modules. - -* [Julep](../../python-sdk-docs/julep/index.md#julep) - * [Api](../../python-sdk-docs/julep/api/index.md#api) - * [Client](client-1.md#client) - * [Core](../../python-sdk-docs/julep/api/core/index.md#core) - * [ApiError](../../python-sdk-docs/julep/api/core/api\_error.md#apierror) - * [Client Wrapper](../../python-sdk-docs/julep/api/core/client\_wrapper.md#client-wrapper) - * [Datetime Utils](../../python-sdk-docs/julep/api/core/datetime\_utils.md#datetime-utils) - * [Jsonable Encoder](../../python-sdk-docs/julep/api/core/jsonable\_encoder.md#jsonable-encoder) - * [Remove None From Dict](../../python-sdk-docs/julep/api/core/remove\_none\_from\_dict.md#remove-none-from-dict) - * [Environment](../../python-sdk-docs/julep/api/environment.md#environment) - * [Types](../../python-sdk-docs/julep/api/types/index.md#types) - * [Agent](../../python-sdk-docs/julep/api/types/agent.md#agent) - * [AgentDefaultSettings](../../python-sdk-docs/julep/api/types/agent\_default\_settings.md#agentdefaultsettings) - * [Belief](../../python-sdk-docs/julep/api/types/belief.md#belief) - * [ChatInputData](../../python-sdk-docs/julep/api/types/chat\_input\_data.md#chatinputdata) - * [ChatMlMessage](../../python-sdk-docs/julep/api/types/chat\_ml\_message.md#chatmlmessage) - * [ChatMlMessageRole](../../python-sdk-docs/julep/api/types/chat\_ml\_message\_role.md#chatmlmessagerole) - * [ChatResponse](../../python-sdk-docs/julep/api/types/chat\_response.md#chatresponse) - * [ChatResponseFinishReason](../../python-sdk-docs/julep/api/types/chat\_response\_finish\_reason.md#chatresponsefinishreason) - * [ChatSettings](../../python-sdk-docs/julep/api/types/chat\_settings.md#chatsettings) - * [ChatSettingsResponseFormat](../../python-sdk-docs/julep/api/types/chat\_settings\_response\_format.md#chatsettingsresponseformat) - * [ChatSettingsResponseFormatSchema](../../python-sdk-docs/julep/api/types/chat\_settings\_response\_format\_schema.md#chatsettingsresponseformatschema) - * [ChatSettingsResponseFormatType](../../python-sdk-docs/julep/api/types/chat\_settings\_response\_format\_type.md#chatsettingsresponseformattype) - * [Chat Settings Stop](../../python-sdk-docs/julep/api/types/chat\_settings\_stop.md#chat-settings-stop) - * [CompletionUsage](../../python-sdk-docs/julep/api/types/completion\_usage.md#completionusage) - * [CreateDoc](../../python-sdk-docs/julep/api/types/create\_doc.md#createdoc) - * [CreateToolRequest](../../python-sdk-docs/julep/api/types/create\_tool\_request.md#createtoolrequest) - * [CreateToolRequestType](../../python-sdk-docs/julep/api/types/create\_tool\_request\_type.md#createtoolrequesttype) - * [Doc](../../python-sdk-docs/julep/api/types/doc.md#doc) - * [Entity](../../python-sdk-docs/julep/api/types/entity.md#entity) - * [Episode](../../python-sdk-docs/julep/api/types/episode.md#episode) - * [FunctionCallOption](../../python-sdk-docs/julep/api/types/function\_call\_option.md#functioncalloption) - * [FunctionDef](../../python-sdk-docs/julep/api/types/function\_def.md#functiondef) - * [Function Parameters](../../python-sdk-docs/julep/api/types/function\_parameters.md#function-parameters) - * [GetAgentDocsResponse](../../python-sdk-docs/julep/api/types/get\_agent\_docs\_response.md#getagentdocsresponse) - * [GetAgentMemoriesResponse](../../python-sdk-docs/julep/api/types/get\_agent\_memories\_response.md#getagentmemoriesresponse) - * [GetAgentToolsResponse](../../python-sdk-docs/julep/api/types/get\_agent\_tools\_response.md#getagenttoolsresponse) - * [GetHistoryResponse](../../python-sdk-docs/julep/api/types/get\_history\_response.md#gethistoryresponse) - * [GetSuggestionsResponse](../../python-sdk-docs/julep/api/types/get\_suggestions\_response.md#getsuggestionsresponse) - * [GetUserDocsResponse](../../python-sdk-docs/julep/api/types/get\_user\_docs\_response.md#getuserdocsresponse) - * [InputChatMlMessage](../../python-sdk-docs/julep/api/types/input\_chat\_ml\_message.md#inputchatmlmessage) - * [InputChatMlMessageRole](../../python-sdk-docs/julep/api/types/input\_chat\_ml\_message\_role.md#inputchatmlmessagerole) - * [Instruction](../../python-sdk-docs/julep/api/types/instruction.md#instruction) - * [ListAgentsResponse](../../python-sdk-docs/julep/api/types/list\_agents\_response.md#listagentsresponse) - * [ListSessionsResponse](../../python-sdk-docs/julep/api/types/list\_sessions\_response.md#listsessionsresponse) - * [ListUsersResponse](../../python-sdk-docs/julep/api/types/list\_users\_response.md#listusersresponse) - * [Memory](../../python-sdk-docs/julep/api/types/memory.md#memory) - * [MemoryAccessOptions](../../python-sdk-docs/julep/api/types/memory\_access\_options.md#memoryaccessoptions) - * [NamedToolChoice](../../python-sdk-docs/julep/api/types/named\_tool\_choice.md#namedtoolchoice) - * [NamedToolChoiceFunction](../../python-sdk-docs/julep/api/types/named\_tool\_choice\_function.md#namedtoolchoicefunction) - * [ResourceCreatedResponse](../../python-sdk-docs/julep/api/types/resource\_created\_response.md#resourcecreatedresponse) - * [ResourceDeletedResponse](../../python-sdk-docs/julep/api/types/resource\_deleted\_response.md#resourcedeletedresponse) - * [ResourceUpdatedResponse](../../python-sdk-docs/julep/api/types/resource\_updated\_response.md#resourceupdatedresponse) - * [Session](../../python-sdk-docs/julep/api/types/session.md#session) - * [Suggestion](../../python-sdk-docs/julep/api/types/suggestion.md#suggestion) - * [SuggestionTarget](../../python-sdk-docs/julep/api/types/suggestion\_target.md#suggestiontarget) - * [Tool](../../python-sdk-docs/julep/api/types/tool.md#tool) - * [Tool Choice Option](../../python-sdk-docs/julep/api/types/tool\_choice\_option.md#tool-choice-option) - * [ToolType](../../python-sdk-docs/julep/api/types/tool\_type.md#tooltype) - * [User](../../python-sdk-docs/julep/api/types/user.md#user) - * [Client](client.md#client) - * [Env](../../python-sdk-docs/julep/env.md#env) - * [Managers](../../python-sdk-docs/julep/managers/index.md#managers) - * [Agent](agent.md#agent) - * [Base](../../python-sdk-docs/julep/managers/base.md#base) - * [Doc](doc.md#doc) - * [Memory](memory.md#memory) - * [Session](session.md#session) - * [Tool](tool.md#tool) - * [Types](../../python-sdk-docs/julep/managers/types.md#types) - * [User](user.md#user) diff --git a/docs/sdks/python-sdk-docs/agent.md b/docs/sdks/python-sdk-docs/agent.md deleted file mode 100644 index 650defaca..000000000 --- a/docs/sdks/python-sdk-docs/agent.md +++ /dev/null @@ -1,646 +0,0 @@ -# Agents - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Managers](../../python-sdk-docs/julep/managers/index.md#managers) / Agent - -> Auto-generated documentation for [julep.managers.agent](../../../julep/managers/agent.py) module. - -* [Agent](agent.md#agent) - * [AgentsManager](agent.md#agentsmanager) - * [AsyncAgentsManager](agent.md#asyncagentsmanager) - * [BaseAgentsManager](agent.md#baseagentsmanager) - -## AgentsManager - -[Show source in agent.py:280](../../../julep/managers/agent.py#L280) - -A class for managing agents, inheriting from [BaseAgentsManager](agent.md#baseagentsmanager). - -This class provides functionalities to interact with and manage agents, including creating, retrieving, listing, updating, and deleting agents. It utilizes type annotations to ensure type correctness at runtime using the `beartype` decorator. - -#### Methods - -* `get(id` - Union\[str, UUID]) -> Agent: Retrieves an agent by its unique identifier. - -#### Arguments - -id (Union\[str, UUID]): The unique identifier of the agent, which can be either a string or a UUID. - -* `name` _str_ - The name of the agent. -* `about` _str_ - A description of the agent. instructions (Union\[List\[str], List\[InstructionDict]]): A list of instructions or dictionaries defining instructions. -* `tools` _List\[ToolDict], optional_ - A list of dictionaries defining tools. Defaults to an empty list. -* `functions` _List\[FunctionDefDict], optional_ - A list of dictionaries defining functions. Defaults to an empty list. -* `default_settings` _DefaultSettingsDict, optional_ - A dictionary of default settings. Defaults to an empty dictionary. -* `model` _ModelName, optional_ - The model name to be used. Defaults to 'julep-ai/samantha-1-turbo'. -* `docs` _List\[DocDict], optional_ - A list of dictionaries defining documentation. Defaults to an empty list. -* `limit` _Optional\[int], optional_ - The maximum number of agents to retrieve. Defaults to None, meaning no limit. -* `offset` _Optional\[int], optional_ - The number of agents to skip (for pagination). Defaults to None. - -agent\_id (Union\[str, UUID]): The unique identifier of the agent to be deleted. - -* `update(*,` _agent\_id_ - Union\[str, UUID], about: Optional\[str]=None, instructions: Optional\[Union\[List\[str], List\[InstructionDict]]]=None, name: Optional\[str]=None, model: Optional\[str]=None, default\_settings: Optional\[DefaultSettingsDict]=None) -> ResourceUpdatedResponse: Updates an existing agent with new details. - -agent\_id (Union\[str, UUID]): The unique identifier of the agent to be updated. - -* `about` _Optional\[str], optional_ - A new description of the agent. Defaults to None (no change). instructions (Optional\[Union\[List\[str], List\[InstructionDict]]], optional): A new list of instructions or dictionaries defining instructions. Defaults to None (no change). -* `name` _Optional\[str], optional_ - A new name for the agent. Defaults to None (no change). -* `model` _Optional\[str], optional_ - A new model name to be used. Defaults to None (no change). -* `default_settings` _Optional\[DefaultSettingsDict], optional_ - A new dictionary of default settings. Defaults to None (no change). - -#### Returns - -* `Agent` - The agent with the corresponding identifier. -* `create(*,` _name_ - str, about: str, instructions: Union\[List\[str], List\[InstructionDict]], tools: List\[ToolDict]=\[], functions: List\[FunctionDefDict]=\[], default\_settings: DefaultSettingsDict={}, model: ModelName='julep-ai/samantha-1-turbo', docs: List\[DocDict]=\[]) -> ResourceCreatedResponse: Creates a new agent with the provided details. -* `ResourceCreatedResponse` - The response indicating the resource (agent) was successfully created. -* `list(*,` _limit_ - Optional\[int]=None, offset: Optional\[int]=None) -> List\[Agent]: Lists all agents with pagination support. -* `List[Agent]` - A list of agents, considering the pagination parameters. -* `delete(agent_id` - Union\[str, UUID]): Deletes an agent by its unique identifier. -* `ResourceUpdatedResponse` - The response indicating the resource (agent) was successfully updated. - -#### Signature - -```python -class AgentsManager(BaseAgentsManager): ... -``` - -#### See also - -* [BaseAgentsManager](agent.md#baseagentsmanager) - -### AgentsManager().create - -[Show source in agent.py:360](../../../julep/managers/agent.py#L360) - -Creates a new resource with the specified details. - -#### Arguments - -* `name` _str_ - The name of the resource. -* `about` _str_ - A description of the resource. instructions (Union\[List\[str], List\[InstructionDict]]): A list of instructions or dictionaries with instruction details. -* `tools` _List\[ToolDict], optional_ - A list of dictionaries with tool details. Defaults to an empty list. -* `functions` _List\[FunctionDefDict], optional_ - A list of dictionaries with function definition details. Defaults to an empty list. -* `default_settings` _DefaultSettingsDict, optional_ - A dictionary with default settings. Defaults to an empty dictionary. -* `model` _ModelName, optional_ - The name of the model to use. Defaults to 'julep-ai/samantha-1-turbo'. -* `docs` _List\[DocDict], optional_ - A list of dictionaries with documentation details. Defaults to an empty list. - -#### Returns - -* `ResourceCreatedResponse` - An object representing the response of the resource creation. - -#### Notes - -This function is decorated with `@beartype`, which will perform runtime type checking on the arguments. - -#### Signature - -```python -@beartype -def create( - self, - name: str, - about: str, - instructions: Union[List[str], List[InstructionDict]], - tools: List[ToolDict] = [], - functions: List[FunctionDefDict] = [], - default_settings: DefaultSettingsDict = {}, - model: ModelName = "julep-ai/samantha-1-turbo", - docs: List[DocDict] = [], -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [ModelName](agent.md#modelname) - -### AgentsManager().delete - -[Show source in agent.py:432](../../../julep/managers/agent.py#L432) - -Delete the agent with the specified ID. - -Args: agent\_id (Union\[str, UUID]): The identifier of the agent to be deleted. - -Returns: The return type depends on the implementation of the `_delete` method. This will typically be `None` if the deletion is successful, or an error may be raised if the deletion fails. - -Note: The `@beartype` decorator is used to enforce type checking of the `agent_id` parameter. - -#### Signature - -```python -@beartype -def delete(self, agent_id: Union[str, UUID]): ... -``` - -### AgentsManager().get - -[Show source in agent.py:343](../../../julep/managers/agent.py#L343) - -Retrieve an Agent object by its identifier. - -#### Arguments - -id (Union\[str, UUID]): The unique identifier of the Agent to be retrieved. - -#### Returns - -* `Agent` - An instance of the Agent with the specified ID. - -#### Raises - -* `BeartypeException` - If the type of `id` is neither a string nor a UUID. Any exception raised by the `_get` method. - -#### Signature - -```python -@beartype -def get(self, id: Union[str, UUID]) -> Agent: ... -``` - -### AgentsManager().list - -[Show source in agent.py:403](../../../julep/managers/agent.py#L403) - -List the Agent objects, possibly with pagination. - -#### Arguments - -* `limit` _Optional\[int], optional_ - The maximum number of Agent objects to return. Defaults to None, meaning no limit is applied. -* `offset` _Optional\[int], optional_ - The number of initial Agent objects to skip before starting to collect the return list. Defaults to None, meaning no offset is applied. - -#### Returns - -* `List[Agent]` - A list of Agent objects. - -#### Raises - -* `BeartypeDecorHintPepParamViolation` - If the function is called with incorrect types for the `limit` or `offset` parameters. - -#### Signature - -```python -@beartype -def list( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> List[Agent]: ... -``` - -### AgentsManager().update - -[Show source in agent.py:449](../../../julep/managers/agent.py#L449) - -Update the properties of a resource. - -This function updates various attributes of an existing resource based on the provided keyword arguments. All updates are optional and are applied only if the corresponding argument is given. - -#### Arguments - -agent\_id (Union\[str, UUID]): The identifier of the agent, either as a string or a UUID object. - -* `about` _Optional\[str], optional_ - A brief description of the agent. Defaults to None. instructions (Optional\[Union\[List\[str], List\[InstructionDict]]], optional): A list of instructions or instruction dictionaries to update the agent with. Defaults to None. -* `name` _Optional\[str], optional_ - The new name to assign to the agent. Defaults to None. -* `model` _Optional\[str], optional_ - The model identifier to associate with the agent. Defaults to None. -* `default_settings` _Optional\[DefaultSettingsDict], optional_ - A dictionary of default settings to apply to the agent. Defaults to None. - -#### Returns - -* `ResourceUpdatedResponse` - An object representing the response to the update request. - -#### Notes - -This method is decorated with `beartype`, which means it enforces type annotations at runtime. - -#### Signature - -```python -@beartype -def update( - self, - agent_id: Union[str, UUID], - about: Optional[str] = None, - instructions: Optional[Union[List[str], List[InstructionDict]]] = None, - name: Optional[str] = None, - model: Optional[str] = None, - default_settings: Optional[DefaultSettingsDict] = None, -) -> ResourceUpdatedResponse: ... -``` - -## AsyncAgentsManager - -[Show source in agent.py:489](../../../julep/managers/agent.py#L489) - -A class for managing asynchronous agent operations. - -This class provides asynchronous methods for creating, retrieving, updating, listing, and deleting agents. It is a subclass of BaseAgentsManager, which defines the underlying functionality and structure that this class utilizes. - -#### Attributes - -None explicitly listed, as they are inherited from the [BaseAgentsManager](agent.md#baseagentsmanager) class. - -#### Methods - -get: Retrieves a single agent by its ID. - -#### Arguments - -id (Union\[UUID, str]): The unique identifier of the agent to retrieve. - -* `name` _str_ - The name of the agent to create. -* `about` _str_ - A description of the agent. instructions (Union\[List\[str], List\[InstructionDict]]): The instructions for operating the agent. -* `tools` _List\[ToolDict], optional_ - An optional list of tools for the agent. -* `functions` _List\[FunctionDefDict], optional_ - An optional list of functions the agent can perform. -* `default_settings` _DefaultSettingsDict, optional_ - Optional default settings for the agent. -* `model` _ModelName, optional_ - The model name to associate with the agent, defaults to 'julep-ai/samantha-1-turbo'. -* `docs` _List\[DocDict], optional_ - An optional list of documents associated with the agent. -* `limit` _Optional\[int], optional_ - The maximum number of agents to retrieve. -* `offset` _Optional\[int], optional_ - The number of agents to skip before starting to collect the results. - -agent\_id (Union\[str, UUID]): The unique identifier of the agent to delete. - -agent\_id (Union\[str, UUID]): The unique identifier of the agent to update. - -* `about` _Optional\[str], optional_ - An optional new description for the agent. instructions (Optional\[Union\[List\[str], List\[InstructionDict]]], optional): Optional new instructions for the agent. -* `name` _Optional\[str], optional_ - An optional new name for the agent. -* `model` _Optional\[str], optional_ - Optional new model associated with the agent. -* `default_settings` _Optional\[DefaultSettingsDict], optional_ - Optional new default settings for the agent. - -#### Returns - -* `Agent` - The requested agent. - -create: Creates a new agent with the provided specifications. - -* `ResourceCreatedResponse` - A response indicating the agent was created successfully. - -list: Lists agents with optional pagination. - -* `List[Agent]` - A list of agents. - -delete: Deletes an agent by its ID. - -The response from the delete operation (specific return type may vary). - -update: Updates the specified fields of an agent by its ID. - -* `ResourceUpdatedResponse` - A response indicating the agent was updated successfully. - -#### Signature - -```python -class AsyncAgentsManager(BaseAgentsManager): ... -``` - -#### See also - -* [BaseAgentsManager](agent.md#baseagentsmanager) - -### AsyncAgentsManager().create - -[Show source in agent.py:579](../../../julep/managers/agent.py#L579) - -Create a new resource asynchronously with specified details. - -This function is decorated with `beartype` to ensure that arguments conform to specified types. - -#### Arguments - -* `name` _str_ - The name of the resource to create. -* `about` _str_ - Information or description about the resource. instructions (Union\[List\[str], List\[InstructionDict]]): A list of strings or dictionaries detailing the instructions for the resource. -* `tools` _List\[ToolDict], optional_ - A list of dictionaries representing the tools associated with the resource. Defaults to an empty list. -* `functions` _List\[FunctionDefDict], optional_ - A list of dictionaries defining functions that can be performed with the resource. Defaults to an empty list. -* `default_settings` _DefaultSettingsDict, optional_ - A dictionary with default settings for the resource. Defaults to an empty dictionary. -* `model` _ModelName, optional_ - The model identifier to use for the resource. Defaults to 'julep-ai/samantha-1-turbo'. -* `docs` _List\[DocDict], optional_ - A list of dictionaries containing documentation for the resource. Defaults to an empty list. - -#### Returns - -* `ResourceCreatedResponse` - An object containing the response data for the resource creation. - -#### Raises - -The exceptions that may be raised are not specified in the signature and depend on the implementation of the \_create method. - -#### Signature - -```python -@beartype -async def create( - self, - name: str, - about: str, - instructions: Union[List[str], List[InstructionDict]], - tools: List[ToolDict] = [], - functions: List[FunctionDefDict] = [], - default_settings: DefaultSettingsDict = {}, - model: ModelName = "julep-ai/samantha-1-turbo", - docs: List[DocDict] = [], -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [ModelName](agent.md#modelname) - -### AsyncAgentsManager().delete - -[Show source in agent.py:651](../../../julep/managers/agent.py#L651) - -Asynchronously deletes an agent given its identifier. - -This function is decorated with @beartype to ensure type checking of the input argument at runtime. - -#### Arguments - -agent\_id (Union\[str, UUID]): The identifier of the agent to be deleted. Can be a string or a UUID object. - -#### Returns - -The result of the asynchronous deletion operation, which is implementation-dependent. - -#### Signature - -```python -@beartype -async def delete(self, agent_id: Union[str, UUID]): ... -``` - -### AsyncAgentsManager().get - -[Show source in agent.py:560](../../../julep/managers/agent.py#L560) - -Asynchronously retrieve an Agent object by its ID. - -The `id` parameter can be either a UUID or a string representation of a UUID. - -#### Arguments - -id (Union\[UUID, str]): The unique identifier of the Agent to retrieve. - -#### Returns - -* `Agent` - The Agent object associated with the given id. - -#### Raises - -* `Beartype` _exceptions_ - If the input id does not conform to the specified types. -* `Other` _exceptions_ - Depending on the implementation of the `_get` method. - -#### Signature - -```python -@beartype -async def get(self, id: Union[UUID, str]) -> Agent: ... -``` - -### AsyncAgentsManager().list - -[Show source in agent.py:624](../../../julep/managers/agent.py#L624) - -Asynchronously lists agents with optional limit and offset. - -This method wraps the call to a private method '\_list\_items' which performs the actual listing of agent items. It uses the 'beartype' decorator for runtime type checking. - -#### Arguments - -* `limit` _Optional\[int], optional_ - The maximum number of agent items to return. Defaults to None, which means no limit. -* `offset` _Optional\[int], optional_ - The offset from where to start the listing. Defaults to None, which means start from the beginning. - -#### Returns - -* `List[Agent]` - A list of agent items collected based on the provided 'limit' and 'offset' parameters. - -#### Signature - -```python -@beartype -async def list( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> List[Agent]: ... -``` - -### AsyncAgentsManager().update - -[Show source in agent.py:666](../../../julep/managers/agent.py#L666) - -Asynchronously update an agent's details. - -This function is decorated with `beartype` to enforce the type checking of parameters. It updates the properties of the agent identified by `agent_id`. - -#### Arguments - -agent\_id (Union\[str, UUID]): Unique identifier for the agent. It can be a string or a UUID object. - -* `about` _Optional\[str]_ - Additional information about the agent. Default is None. instructions (Optional\[Union\[List\[str], List\[InstructionDict]]]): A list of instructions or instruction dictionaries. Default is None. -* `name` _Optional\[str]_ - The name of the agent. Default is None. -* `model` _Optional\[str]_ - The model identifier or name. Default is None. -* `default_settings` _Optional\[DefaultSettingsDict]_ - Dictionary with default settings for the agent. Default is None. - -#### Returns - -* `ResourceUpdatedResponse` - An object containing the details of the update response. - -#### Signature - -```python -@beartype -async def update( - self, - agent_id: Union[str, UUID], - about: Optional[str] = None, - instructions: Optional[Union[List[str], List[InstructionDict]]] = None, - name: Optional[str] = None, - model: Optional[str] = None, - default_settings: Optional[DefaultSettingsDict] = None, -) -> ResourceUpdatedResponse: ... -``` - -## BaseAgentsManager - -[Show source in agent.py:39](../../../julep/managers/agent.py#L39) - -A class responsible for managing agent entities. - -This manager handles CRUD operations for agents including retrieving, creating, listing, deleting, and updating agents using an API client. - -#### Attributes - -* `api_client` _ApiClientType_ - The client responsible for API interactions. - -#### Methods - -* `_get(self,` _id_ - Union\[str, UUID]) -> Union\[Agent, Awaitable\[Agent]]: Retrieves a single agent by its UUID. - -#### Arguments - -id (Union\[str, UUID]): The UUID of the agent to retrieve. - -* `name` _str_ - The name of the new agent. -* `about` _str_ - Description about the new agent. instructions (Union\[List\[str], List\[InstructionDict]]): List of instructions or instruction dictionaries for the new agent. -* `tools` _List\[ToolDict], optional_ - List of tool dictionaries. Defaults to an empty list. -* `functions` _List\[FunctionDefDict], optional_ - List of function definition dictionaries. Defaults to an empty list. -* `default_settings` _DefaultSettingsDict, optional_ - Dictionary of default settings for the new agent. Defaults to an empty dictionary. -* `model` _ModelName, optional_ - The model name for the new agent. Defaults to 'julep-ai/samantha-1-turbo'. -* `docs` _List\[DocDict], optional_ - List of document dictionaries for the new agent. Defaults to an empty list. -* `limit` _Optional\[int], optional_ - The maximum number of agents to list. Defaults to None. -* `offset` _Optional\[int], optional_ - The number of agents to skip (for pagination). Defaults to None. agent\_id (Union\[str, UUID]): The UUID of the agent to delete. agent\_id (Union\[str, UUID]): The UUID of the agent to update. -* `about` _Optional\[str], optional_ - The new description about the agent. instructions (Optional\[Union\[List\[str], List\[InstructionDict]]], optional): The new list of instructions or instruction dictionaries. -* `name` _Optional\[str], optional_ - The new name for the agent. -* `model` _Optional\[str], optional_ - The new model name for the agent. -* `default_settings` _Optional\[DefaultSettingsDict], optional_ - The new default settings dictionary for the agent. - -#### Returns - -The agent object or an awaitable that resolves to the agent object. - -* `_create(self,` _name_ - str, about: str, instructions: Union\[List\[str], List\[InstructionDict]], tools: List\[ToolDict] = \[], functions: List\[FunctionDefDict] = \[], default\_settings: DefaultSettingsDict = {}, model: ModelName = 'julep-ai/samantha-1-turbo', docs: List\[DocDict] = \[]) -> Union\[ResourceCreatedResponse, Awaitable\[ResourceCreatedResponse]]: Creates an agent with the given specifications. The response indicating creation or an awaitable that resolves to the creation response. -* `_list_items(self,` _limit_ - Optional\[int] = None, offset: Optional\[int] = None) -> Union\[ListAgentsResponse, Awaitable\[ListAgentsResponse]]: Lists agents with pagination support. The list of agents or an awaitable that resolves to the list of agents. -* `_delete(self,` _agent\_id_ - Union\[str, UUID]) -> Union\[None, Awaitable\[None]]: Deletes an agent with the specified UUID. None or an awaitable that resolves to None. -* `_update(self,` _agent\_id_ - Union\[str, UUID], about: Optional\[str] = None, instructions: Optional\[Union\[List\[str], List\[InstructionDict]]] = None, name: Optional\[str] = None, model: Optional\[str] = None, default\_settings: Optional\[DefaultSettingsDict] = None) -> Union\[ResourceUpdatedResponse, Awaitable\[ResourceUpdatedResponse]]: Updates the specified fields of an agent. The response indicating successful update or an awaitable that resolves to the update response. - -#### Signature - -```python -class BaseAgentsManager(BaseManager): ... -``` - -### BaseAgentsManager().\_create - -[Show source in agent.py:114](../../../julep/managers/agent.py#L114) - -Create a new agent with the specified configuration. - -#### Arguments - -* `name` _str_ - Name of the agent. -* `about` _str_ - Information about the agent. instructions (Union\[List\[str], List\[InstructionDict]]): List of instructions as either string or dictionaries for the agent. -* `tools` _List\[ToolDict], optional_ - List of tool configurations for the agent. Defaults to an empty list. -* `functions` _List\[FunctionDefDict], optional_ - List of function definitions for the agent. Defaults to an empty list. -* `default_settings` _DefaultSettingsDict, optional_ - Dictionary of default settings for the agent. Defaults to an empty dict. -* `model` _ModelName, optional_ - The model name identifier. Defaults to 'julep-ai/samantha-1-turbo'. -* `docs` _List\[DocDict], optional_ - List of document configurations for the agent. Defaults to an empty list. - -#### Returns - -* `Union[ResourceCreatedResponse,` _Awaitable\[ResourceCreatedResponse]]_ - The response object indicating the resource has been created or a future of the response object if the creation is being awaited. - -#### Raises - -* `AssertionError` - If both functions and tools are provided. - -#### Notes - -The `_create` method is meant to be used internally and should be considered private. It assumes the input data for instructions, tools, and docs will have the proper format, and items in the 'instructions' list will be converted to Instruction instances. - -#### Signature - -```python -def _create( - self, - name: str, - about: str, - instructions: Union[List[str], List[InstructionDict]], - tools: List[ToolDict] = [], - functions: List[FunctionDefDict] = [], - default_settings: DefaultSettingsDict = {}, - model: ModelName = "julep-ai/samantha-1-turbo", - docs: List[DocDict] = [], -) -> Union[ResourceCreatedResponse, Awaitable[ResourceCreatedResponse]]: ... -``` - -#### See also - -* [ModelName](agent.md#modelname) - -### BaseAgentsManager().\_delete - -[Show source in agent.py:208](../../../julep/managers/agent.py#L208) - -Delete an agent by its ID. - -#### Arguments - -agent\_id (Union\[str, UUID]): The UUID v4 of the agent to be deleted. - -#### Returns - -* `Union[None,` _Awaitable\[None]]_ - A future that resolves to None if the operation is asynchronous, or None immediately if the operation is synchronous. - -#### Raises - -* `AssertionError` - If `agent_id` is not a valid UUID v4. - -#### Signature - -```python -def _delete(self, agent_id: Union[str, UUID]) -> Union[None, Awaitable[None]]: ... -``` - -### BaseAgentsManager().\_get - -[Show source in agent.py:98](../../../julep/managers/agent.py#L98) - -Retrieves an agent based on the provided identifier. - -#### Arguments - -id (Union\[str, UUID]): The identifier of the agent, which can be a string or UUID object. - -#### Returns - -* `Union[Agent,` _Awaitable\[Agent]]_ - The agent object or an awaitable yielding the agent object, depending on the API client. - -#### Raises - -* `AssertionError` - If the provided id is not a valid UUID v4. - -#### Signature - -```python -def _get(self, id: Union[str, UUID]) -> Union[Agent, Awaitable[Agent]]: ... -``` - -### BaseAgentsManager().\_list\_items - -[Show source in agent.py:188](../../../julep/managers/agent.py#L188) - -Lists items with optional pagination. - -This method wraps the `list_agents` API call and includes optional limit and offset parameters for pagination. - -Args: limit (Optional\[int], optional): The maximum number of items to return. Defaults to None, which means no limit. offset (Optional\[int], optional): The index of the first item to return. Defaults to None, which means no offset. - -Returns: Union\[ListAgentsResponse, Awaitable\[ListAgentsResponse]]: A ListAgentsResponse object, or an awaitable that resolves to a ListAgentsResponse object. - -#### Signature - -```python -def _list_items( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> Union[ListAgentsResponse, Awaitable[ListAgentsResponse]]: ... -``` - -### BaseAgentsManager().\_update - -[Show source in agent.py:226](../../../julep/managers/agent.py#L226) - -Update the agent's properties. - -Args: agent\_id (Union\[str, UUID]): The unique identifier for the agent, which can be a string or UUID object. about (Optional\[str], optional): A brief description of the agent. Defaults to None. instructions (Optional\[Union\[List\[str], List\[InstructionDict]]], optional): A list of either strings or instruction dictionaries that will be converted into Instruction objects. Defaults to None. name (Optional\[str], optional): The name of the agent. Defaults to None. model (Optional\[str], optional): The model identifier for the agent. Defaults to None. default\_settings (Optional\[DefaultSettingsDict], optional): A dictionary of default settings to apply to the agent. Defaults to None. - -Returns: Union\[ResourceUpdatedResponse, Awaitable\[ResourceUpdatedResponse]]: An object representing the response for the resource updated, which can also be an awaitable in asynchronous contexts. - -Raises: AssertionError: If the provided agent\_id is not a valid UUID v4. - -Note: This method asserts that the agent\_id must be a valid UUID v4. The instructions and default\_settings, if provided, are converted into their respective object types before making the update API call. - -#### Signature - -```python -def _update( - self, - agent_id: Union[str, UUID], - about: Optional[str] = None, - instructions: Optional[Union[List[str], List[InstructionDict]]] = None, - name: Optional[str] = None, - model: Optional[str] = None, - default_settings: Optional[DefaultSettingsDict] = None, -) -> Union[ResourceUpdatedResponse, Awaitable[ResourceUpdatedResponse]]: ... -``` diff --git a/docs/sdks/python-sdk-docs/client-1.md b/docs/sdks/python-sdk-docs/client-1.md deleted file mode 100644 index 8fa2ed3a4..000000000 --- a/docs/sdks/python-sdk-docs/client-1.md +++ /dev/null @@ -1,1716 +0,0 @@ -# API - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Api](../../python-sdk-docs/julep/api/index.md#api) / Client - -> Auto-generated documentation for [julep.api.client](../../../julep/api/client.py) module. - -#### Attributes - -* `OMIT` - this is used as the default value for optional parameters: typing.cast(typing.Any, ...) -* [Client](client-1.md#client) - * [AsyncJulepApi](client-1.md#asyncjulepapi) - * [JulepApi](client-1.md#julepapi) - -## AsyncJulepApi - -[Show source in client.py:1415](../../../julep/api/client.py#L1415) - -#### Signature - -```python -class AsyncJulepApi: - def __init__( - self, - base_url: typing.Optional[str] = None, - environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, - api_key: str, - timeout: typing.Optional[float] = 300, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - ): ... -``` - -### AsyncJulepApi().chat - -[Show source in client.py:1892](../../../julep/api/client.py#L1892) - -#### Arguments - -* `-` _session\_id_ - str. -* `-` _messages_ - typing.List\[InputChatMlMessage]. A list of new input messages comprising the conversation so far. -* `-` _tools_ - typing.Optional\[typing.List\[Tool]]. (Advanced) List of tools that are provided in addition to agent's default set of tools. Functions of same name in agent set are overriden -* `-` _tool\_choice_ - typing.Optional\[ToolChoiceOption]. Can be one of existing tools given to the agent earlier or the ones included in the request -* `-` _frequency\_penalty_ - typing.Optional\[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. -* `-` _length\_penalty_ - typing.Optional\[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. -* `-` _logit\_bias_ - typing.Optional\[typing.Dict\[str, typing.Optional\[int]]]. Modify the likelihood of specified tokens appearing in the completion. - - ``` - Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. - ``` -* `-` _max\_tokens_ - typing.Optional\[int]. The maximum number of tokens to generate in the chat completion. - - ``` - The total length of input tokens and generated tokens is limited by the model's context length. - ``` -* `-` _presence\_penalty_ - typing.Optional\[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. -* `-` _repetition\_penalty_ - typing.Optional\[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. -* `-` _response\_format_ - typing.Optional\[ChatSettingsResponseFormat]. An object specifying the format that the model must output. - -Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. - -``` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. -``` - -* `-` _seed_ - typing.Optional\[int]. This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. -* `-` _stop_ - typing.Optional\[ChatSettingsStop]. Up to 4 sequences where the API will stop generating further tokens. -* `-` _stream_ - typing.Optional\[bool]. If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent\_events/Using\_server-sent\_events#Event\_stream\_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how\_to\_stream\_completions). -* `-` _temperature_ - typing.Optional\[float]. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. -* `-` _top\_p_ - typing.Optional\[float]. Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top\_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. -* `-` _recall_ - typing.Optional\[bool]. Whether previous memories should be recalled or not - * `-` _remember_ - typing.Optional\[bool]. Whether this interaction should be recorded in memory or not - -*** - -from julep import InputChatMlMessage, InputChatMlMessageRole from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.chat( session\_id="session\_id", messages=\[ InputChatMlMessage( role=InputChatMlMessageRole.USER, content="content", ) ], ) - -#### Signature - -```python -async def chat( - self, - session_id: str, - messages: typing.List[InputChatMlMessage], - tools: typing.Optional[typing.List[Tool]] = OMIT, - tool_choice: typing.Optional[ToolChoiceOption] = OMIT, - frequency_penalty: typing.Optional[float] = OMIT, - length_penalty: typing.Optional[float] = OMIT, - logit_bias: typing.Optional[typing.Dict[str, typing.Optional[int]]] = OMIT, - max_tokens: typing.Optional[int] = OMIT, - presence_penalty: typing.Optional[float] = OMIT, - repetition_penalty: typing.Optional[float] = OMIT, - response_format: typing.Optional[ChatSettingsResponseFormat] = OMIT, - seed: typing.Optional[int] = OMIT, - stop: typing.Optional[ChatSettingsStop] = OMIT, - stream: typing.Optional[bool] = OMIT, - temperature: typing.Optional[float] = OMIT, - top_p: typing.Optional[float] = OMIT, - recall: typing.Optional[bool] = OMIT, - remember: typing.Optional[bool] = OMIT, -) -> ChatResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### AsyncJulepApi().create\_agent - -[Show source in client.py:1632](../../../julep/api/client.py#L1632) - -Create a new agent - -#### Arguments - -* `-` _name_ - str. Name of the agent -* `-` _about_ - str. About the agent -* `-` _instructions_ - typing.Optional\[typing.List\[Instruction]]. List of instructions for the agent -* `-` _tools_ - typing.Optional\[typing.List\[CreateToolRequest]]. A list of tools the model may call. Currently, only `function`s are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. -* `-` _default\_settings_ - typing.Optional\[AgentDefaultSettings]. Default model settings to start every session with -* `-` _model_ - str. Name of the model that the agent is supposed to use - * `-` _docs_ - typing.Optional\[typing.List\[CreateDoc]]. List of docs about agent - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.create\_agent( name="name", about="about", model="model", ) - -#### Signature - -```python -async def create_agent( - self, - name: str, - about: str, - instructions: typing.Optional[typing.List[str]] = OMIT, - tools: typing.Optional[typing.List[CreateToolRequest]] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, - model: str, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### AsyncJulepApi().create\_agent\_doc - -[Show source in client.py:2373](../../../julep/api/client.py#L2373) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _request_ - CreateDoc. - -*** - -from julep import CreateDoc from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.create\_agent\_doc( agent\_id="agent\_id", request=CreateDoc( title="title", content="content", ), ) - -#### Signature - -```python -async def create_agent_doc( - self, agent_id: str, request: CreateDoc -) -> ResourceCreatedResponse: ... -``` - -### AsyncJulepApi().create\_agent\_tool - -[Show source in client.py:2652](../../../julep/api/client.py#L2652) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _request_ - CreateToolRequest. - -*** - -from julep import CreateToolRequest, CreateToolRequestType, FunctionDef from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.create\_agent\_tool( agent\_id="agent\_id", request=CreateToolRequest( type=CreateToolRequestType.FUNCTION, function=FunctionDef( name="name", parameters={}, ), ), ) - -#### Signature - -```python -async def create_agent_tool( - self, agent_id: str, request: CreateToolRequest -) -> ResourceCreatedResponse: ... -``` - -### AsyncJulepApi().create\_session - -[Show source in client.py:1468](../../../julep/api/client.py#L1468) - -Create a session between an agent and a user - -#### Arguments - -* `-` _user\_id_ - str. User ID of user to associate with this session -* `-` _agent\_id_ - str. Agent ID of agent to associate with this session - * `-` _situation_ - typing.Optional\[str]. A specific situation that sets the background for this session - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.create\_session( user\_id="user\_id", agent\_id="agent\_id", ) - -#### Signature - -```python -async def create_session( - self, user_id: str, agent_id: str, situation: typing.Optional[str] = OMIT -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### AsyncJulepApi().create\_user - -[Show source in client.py:1549](../../../julep/api/client.py#L1549) - -Create a new user - -#### Arguments - -* `-` _name_ - typing.Optional\[str]. Name of the user -* `-` _about_ - typing.Optional\[str]. About the user - * `-` _docs_ - typing.Optional\[typing.List\[CreateDoc]]. List of docs about user - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.create\_user() - -#### Signature - -```python -async def create_user( - self, - name: typing.Optional[str] = OMIT, - about: typing.Optional[str] = OMIT, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### AsyncJulepApi().create\_user\_doc - -[Show source in client.py:2458](../../../julep/api/client.py#L2458) - -#### Arguments - -* `-` _user\_id_ - str. - * `-` _request_ - CreateDoc. - -*** - -from julep import CreateDoc from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.create\_user\_doc( user\_id="user\_id", request=CreateDoc( title="title", content="content", ), ) - -#### Signature - -```python -async def create_user_doc( - self, user_id: str, request: CreateDoc -) -> ResourceCreatedResponse: ... -``` - -### AsyncJulepApi().delete\_agent - -[Show source in client.py:2298](../../../julep/api/client.py#L2298) - -#### Arguments - -``` -- `-` *agent_id* - str. -``` - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_agent( agent\_id="agent\_id", ) - -#### Signature - -```python -async def delete_agent(self, agent_id: str) -> None: ... -``` - -### AsyncJulepApi().delete\_agent\_doc - -[Show source in client.py:2536](../../../julep/api/client.py#L2536) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _doc\_id_ - str. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_agent\_doc( agent\_id="agent\_id", doc\_id="doc\_id", ) - -#### Signature - -```python -async def delete_agent_doc(self, agent_id: str, doc_id: str) -> None: ... -``` - -### AsyncJulepApi().delete\_agent\_memory - -[Show source in client.py:2572](../../../julep/api/client.py#L2572) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _memory\_id_ - str. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_agent\_memory( agent\_id="agent\_id", memory\_id="memory\_id", ) - -#### Signature - -```python -async def delete_agent_memory(self, agent_id: str, memory_id: str) -> None: ... -``` - -### AsyncJulepApi().delete\_agent\_tool - -[Show source in client.py:2744](../../../julep/api/client.py#L2744) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _tool\_id_ - str. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_agent\_tool( agent\_id="agent\_id", tool\_id="tool\_id", ) - -#### Signature - -```python -async def delete_agent_tool(self, agent_id: str, tool_id: str) -> None: ... -``` - -### AsyncJulepApi().delete\_session - -[Show source in client.py:1772](../../../julep/api/client.py#L1772) - -#### Arguments - -``` -- `-` *session_id* - str. -``` - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_session( session\_id="session\_id", ) - -#### Signature - -```python -async def delete_session(self, session_id: str) -> None: ... -``` - -### AsyncJulepApi().delete\_user - -[Show source in client.py:2171](../../../julep/api/client.py#L2171) - -#### Arguments - -``` -- `-` *user_id* - str. -``` - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_user( user\_id="user\_id", ) - -#### Signature - -```python -async def delete_user(self, user_id: str) -> None: ... -``` - -### AsyncJulepApi().delete\_user\_doc - -[Show source in client.py:2500](../../../julep/api/client.py#L2500) - -#### Arguments - -* `-` _user\_id_ - str. - * `-` _doc\_id_ - str. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.delete\_user\_doc( user\_id="user\_id", doc\_id="doc\_id", ) - -#### Signature - -```python -async def delete_user_doc(self, user_id: str, doc_id: str) -> None: ... -``` - -### AsyncJulepApi().get\_agent - -[Show source in client.py:2203](../../../julep/api/client.py#L2203) - -#### Arguments - -``` -- `-` *agent_id* - str. -``` - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_agent( agent\_id="agent\_id", ) - -#### Signature - -```python -async def get_agent(self, agent_id: str) -> Agent: ... -``` - -### AsyncJulepApi().get\_agent\_docs - -[Show source in client.py:2330](../../../julep/api/client.py#L2330) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_agent\_docs( agent\_id="agent\_id", ) - -#### Signature - -```python -async def get_agent_docs( - self, - agent_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetAgentDocsResponse: ... -``` - -### AsyncJulepApi().get\_agent\_memories - -[Show source in client.py:2029](../../../julep/api/client.py#L2029) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _query_ - str. -* `-` _types_ - typing.Optional\[typing.Union\[str, typing.List\[str]]]. episode, belief, entity -* `-` _user\_id_ - typing.Optional\[str]. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_agent\_memories( agent\_id="agent\_id", query="query", ) - -#### Signature - -```python -async def get_agent_memories( - self, - agent_id: str, - query: str, - types: typing.Optional[typing.Union[str, typing.List[str]]] = None, - user_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetAgentMemoriesResponse: ... -``` - -### AsyncJulepApi().get\_agent\_tools - -[Show source in client.py:2608](../../../julep/api/client.py#L2608) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_agent\_tools( agent\_id="agent\_id", ) - -#### Signature - -```python -async def get_agent_tools( - self, - agent_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetAgentToolsResponse: ... -``` - -### AsyncJulepApi().get\_history - -[Show source in client.py:1848](../../../julep/api/client.py#L1848) - -Sorted (created\_at ascending) - -#### Arguments - -* `-` _session\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_history( session\_id="session\_id", ) - -#### Signature - -```python -async def get_history( - self, - session_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetHistoryResponse: ... -``` - -### AsyncJulepApi().get\_session - -[Show source in client.py:1702](../../../julep/api/client.py#L1702) - -#### Arguments - -``` -- `-` *session_id* - str. -``` - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_session( session\_id="session\_id", ) - -#### Signature - -```python -async def get_session(self, session_id: str) -> Session: ... -``` - -### AsyncJulepApi().get\_suggestions - -[Show source in client.py:1804](../../../julep/api/client.py#L1804) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _session\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_suggestions( session\_id="session\_id", ) - -#### Signature - -```python -async def get_suggestions( - self, - session_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetSuggestionsResponse: ... -``` - -### AsyncJulepApi().get\_user - -[Show source in client.py:2091](../../../julep/api/client.py#L2091) - -#### Arguments - -``` -- `-` *user_id* - str. -``` - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_user( user\_id="user\_id", ) - -#### Signature - -```python -async def get_user(self, user_id: str) -> User: ... -``` - -### AsyncJulepApi().get\_user\_docs - -[Show source in client.py:2415](../../../julep/api/client.py#L2415) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _user\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.get\_user\_docs( user\_id="user\_id", ) - -#### Signature - -```python -async def get_user_docs( - self, - user_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetUserDocsResponse: ... -``` - -### AsyncJulepApi().list\_agents - -[Show source in client.py:1597](../../../julep/api/client.py#L1597) - -List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -#### Arguments - -* `-` _limit_ - typing.Optional\[int]. Number of items to return - * `-` _offset_ - typing.Optional\[int]. Number of items to skip (sorted created\_at descending order) - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.list\_agents() - -#### Signature - -```python -async def list_agents( - self, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None -) -> ListAgentsResponse: ... -``` - -### AsyncJulepApi().list\_sessions - -[Show source in client.py:1433](../../../julep/api/client.py#L1433) - -List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -#### Arguments - -* `-` _limit_ - typing.Optional\[int]. Number of sessions to return - * `-` _offset_ - typing.Optional\[int]. Number of sessions to skip (sorted created\_at descending order) - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.list\_sessions() - -#### Signature - -```python -async def list_sessions( - self, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None -) -> ListSessionsResponse: ... -``` - -### AsyncJulepApi().list\_users - -[Show source in client.py:1514](../../../julep/api/client.py#L1514) - -List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -#### Arguments - -* `-` _limit_ - typing.Optional\[int]. Number of items to return - * `-` _offset_ - typing.Optional\[int]. Number of items to skip (sorted created\_at descending order) - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.list\_users() - -#### Signature - -```python -async def list_users( - self, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None -) -> ListUsersResponse: ... -``` - -### AsyncJulepApi().update\_agent - -[Show source in client.py:2235](../../../julep/api/client.py#L2235) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _about_ - typing.Optional\[str]. About the agent -* `-` _instructions_ - typing.Optional\[typing.List\[Instruction]]. List of instructions for the agent -* `-` _name_ - typing.Optional\[str]. Name of the agent -* `-` _model_ - typing.Optional\[str]. Name of the model that the agent is supposed to use - * `-` _default\_settings_ - typing.Optional\[AgentDefaultSettings]. Default model settings to start every session with - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.update\_agent( agent\_id="agent\_id", ) - -#### Signature - -```python -async def update_agent( - self, - agent_id: str, - about: typing.Optional[str] = OMIT, - instructions: typing.Optional[typing.List[str]] = OMIT, - name: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, -) -> ResourceUpdatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### AsyncJulepApi().update\_agent\_tool - -[Show source in client.py:2698](../../../julep/api/client.py#L2698) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _tool\_id_ - str. - * `-` _function_ - FunctionDef. Function definition and parameters - -*** - -from julep import FunctionDef from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.update\_agent\_tool( agent\_id="agent\_id", tool\_id="tool\_id", function=FunctionDef( name="name", parameters={}, ), ) - -#### Signature - -```python -async def update_agent_tool( - self, agent_id: str, tool_id: str, function: FunctionDef -) -> ResourceUpdatedResponse: ... -``` - -### AsyncJulepApi().update\_session - -[Show source in client.py:1734](../../../julep/api/client.py#L1734) - -#### Arguments - -* `-` _session\_id_ - str. - * `-` _situation_ - str. Updated situation for this session - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.update\_session( session\_id="session\_id", situation="situation", ) - -#### Signature - -```python -async def update_session( - self, session_id: str, situation: str -) -> ResourceUpdatedResponse: ... -``` - -### AsyncJulepApi().update\_user - -[Show source in client.py:2123](../../../julep/api/client.py#L2123) - -#### Arguments - -* `-` _user\_id_ - str. -* `-` _about_ - typing.Optional\[str]. About the user - * `-` _name_ - typing.Optional\[str]. Name of the user - -*** - -from julep.client import AsyncJulepApi - -client = AsyncJulepApi( api\_key="YOUR\_API\_KEY", ) await client.update\_user( user\_id="user\_id", ) - -#### Signature - -```python -async def update_user( - self, - user_id: str, - about: typing.Optional[str] = OMIT, - name: typing.Optional[str] = OMIT, -) -> ResourceUpdatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -## JulepApi - -[Show source in client.py:49](../../../julep/api/client.py#L49) - -#### Signature - -```python -class JulepApi: - def __init__( - self, - base_url: typing.Optional[str] = None, - environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, - api_key: str, - timeout: typing.Optional[float] = 300, - httpx_client: typing.Optional[httpx.Client] = None, - ): ... -``` - -### JulepApi().chat - -[Show source in client.py:526](../../../julep/api/client.py#L526) - -#### Arguments - -* `-` _session\_id_ - str. -* `-` _messages_ - typing.List\[InputChatMlMessage]. A list of new input messages comprising the conversation so far. -* `-` _tools_ - typing.Optional\[typing.List\[Tool]]. (Advanced) List of tools that are provided in addition to agent's default set of tools. Functions of same name in agent set are overriden -* `-` _tool\_choice_ - typing.Optional\[ToolChoiceOption]. Can be one of existing tools given to the agent earlier or the ones included in the request -* `-` _frequency\_penalty_ - typing.Optional\[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. -* `-` _length\_penalty_ - typing.Optional\[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. -* `-` _logit\_bias_ - typing.Optional\[typing.Dict\[str, typing.Optional\[int]]]. Modify the likelihood of specified tokens appearing in the completion. - - ``` - Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. - ``` -* `-` _max\_tokens_ - typing.Optional\[int]. The maximum number of tokens to generate in the chat completion. - - ``` - The total length of input tokens and generated tokens is limited by the model's context length. - ``` -* `-` _presence\_penalty_ - typing.Optional\[float]. (OpenAI-like) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. -* `-` _repetition\_penalty_ - typing.Optional\[float]. (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. -* `-` _response\_format_ - typing.Optional\[ChatSettingsResponseFormat]. An object specifying the format that the model must output. - -Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. - -``` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. -``` - -* `-` _seed_ - typing.Optional\[int]. This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. -* `-` _stop_ - typing.Optional\[ChatSettingsStop]. Up to 4 sequences where the API will stop generating further tokens. -* `-` _stream_ - typing.Optional\[bool]. If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent\_events/Using\_server-sent\_events#Event\_stream\_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how\_to\_stream\_completions). -* `-` _temperature_ - typing.Optional\[float]. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. -* `-` _top\_p_ - typing.Optional\[float]. Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top\_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. -* `-` _recall_ - typing.Optional\[bool]. Whether previous memories should be recalled or not - * `-` _remember_ - typing.Optional\[bool]. Whether this interaction should be recorded in memory or not - -*** - -from julep import InputChatMlMessage, InputChatMlMessageRole from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.chat( session\_id="session\_id", messages=\[ InputChatMlMessage( role=InputChatMlMessageRole.USER, content="content", ) ], ) - -#### Signature - -```python -def chat( - self, - session_id: str, - messages: typing.List[InputChatMlMessage], - tools: typing.Optional[typing.List[Tool]] = OMIT, - tool_choice: typing.Optional[ToolChoiceOption] = OMIT, - frequency_penalty: typing.Optional[float] = OMIT, - length_penalty: typing.Optional[float] = OMIT, - logit_bias: typing.Optional[typing.Dict[str, typing.Optional[int]]] = OMIT, - max_tokens: typing.Optional[int] = OMIT, - presence_penalty: typing.Optional[float] = OMIT, - repetition_penalty: typing.Optional[float] = OMIT, - response_format: typing.Optional[ChatSettingsResponseFormat] = OMIT, - seed: typing.Optional[int] = OMIT, - stop: typing.Optional[ChatSettingsStop] = OMIT, - stream: typing.Optional[bool] = OMIT, - temperature: typing.Optional[float] = OMIT, - top_p: typing.Optional[float] = OMIT, - recall: typing.Optional[bool] = OMIT, - remember: typing.Optional[bool] = OMIT, -) -> ChatResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### JulepApi().create\_agent - -[Show source in client.py:266](../../../julep/api/client.py#L266) - -Create a new agent - -#### Arguments - -* `-` _name_ - str. Name of the agent -* `-` _about_ - str. About the agent -* `-` _instructions_ - typing.Optional\[typing.List\[Instruction]]. List of instructions for the agent -* `-` _tools_ - typing.Optional\[typing.List\[CreateToolRequest]]. A list of tools the model may call. Currently, only `function`s are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. -* `-` _default\_settings_ - typing.Optional\[AgentDefaultSettings]. Default model settings to start every session with -* `-` _model_ - str. Name of the model that the agent is supposed to use - * `-` _docs_ - typing.Optional\[typing.List\[CreateDoc]]. List of docs about agent - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.create\_agent( name="name", about="about", model="model", ) - -#### Signature - -```python -def create_agent( - self, - name: str, - about: str, - instructions: typing.Optional[typing.List[str]] = OMIT, - tools: typing.Optional[typing.List[CreateToolRequest]] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, - model: str, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### JulepApi().create\_agent\_doc - -[Show source in client.py:1007](../../../julep/api/client.py#L1007) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _request_ - CreateDoc. - -*** - -from julep import CreateDoc from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.create\_agent\_doc( agent\_id="agent\_id", request=CreateDoc( title="title", content="content", ), ) - -#### Signature - -```python -def create_agent_doc( - self, agent_id: str, request: CreateDoc -) -> ResourceCreatedResponse: ... -``` - -### JulepApi().create\_agent\_tool - -[Show source in client.py:1286](../../../julep/api/client.py#L1286) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _request_ - CreateToolRequest. - -*** - -from julep import CreateToolRequest, CreateToolRequestType, FunctionDef from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.create\_agent\_tool( agent\_id="agent\_id", request=CreateToolRequest( type=CreateToolRequestType.FUNCTION, function=FunctionDef( name="name", parameters={}, ), ), ) - -#### Signature - -```python -def create_agent_tool( - self, agent_id: str, request: CreateToolRequest -) -> ResourceCreatedResponse: ... -``` - -### JulepApi().create\_session - -[Show source in client.py:102](../../../julep/api/client.py#L102) - -Create a session between an agent and a user - -#### Arguments - -* `-` _user\_id_ - str. User ID of user to associate with this session -* `-` _agent\_id_ - str. Agent ID of agent to associate with this session - * `-` _situation_ - typing.Optional\[str]. A specific situation that sets the background for this session - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.create\_session( user\_id="user\_id", agent\_id="agent\_id", ) - -#### Signature - -```python -def create_session( - self, user_id: str, agent_id: str, situation: typing.Optional[str] = OMIT -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### JulepApi().create\_user - -[Show source in client.py:183](../../../julep/api/client.py#L183) - -Create a new user - -#### Arguments - -* `-` _name_ - typing.Optional\[str]. Name of the user -* `-` _about_ - typing.Optional\[str]. About the user - * `-` _docs_ - typing.Optional\[typing.List\[CreateDoc]]. List of docs about user - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.create\_user() - -#### Signature - -```python -def create_user( - self, - name: typing.Optional[str] = OMIT, - about: typing.Optional[str] = OMIT, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, -) -> ResourceCreatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### JulepApi().create\_user\_doc - -[Show source in client.py:1092](../../../julep/api/client.py#L1092) - -#### Arguments - -* `-` _user\_id_ - str. - * `-` _request_ - CreateDoc. - -*** - -from julep import CreateDoc from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.create\_user\_doc( user\_id="user\_id", request=CreateDoc( title="title", content="content", ), ) - -#### Signature - -```python -def create_user_doc( - self, user_id: str, request: CreateDoc -) -> ResourceCreatedResponse: ... -``` - -### JulepApi().delete\_agent - -[Show source in client.py:932](../../../julep/api/client.py#L932) - -#### Arguments - -``` -- `-` *agent_id* - str. -``` - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_agent( agent\_id="agent\_id", ) - -#### Signature - -```python -def delete_agent(self, agent_id: str) -> None: ... -``` - -### JulepApi().delete\_agent\_doc - -[Show source in client.py:1170](../../../julep/api/client.py#L1170) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _doc\_id_ - str. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_agent\_doc( agent\_id="agent\_id", doc\_id="doc\_id", ) - -#### Signature - -```python -def delete_agent_doc(self, agent_id: str, doc_id: str) -> None: ... -``` - -### JulepApi().delete\_agent\_memory - -[Show source in client.py:1206](../../../julep/api/client.py#L1206) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _memory\_id_ - str. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_agent\_memory( agent\_id="agent\_id", memory\_id="memory\_id", ) - -#### Signature - -```python -def delete_agent_memory(self, agent_id: str, memory_id: str) -> None: ... -``` - -### JulepApi().delete\_agent\_tool - -[Show source in client.py:1378](../../../julep/api/client.py#L1378) - -#### Arguments - -* `-` _agent\_id_ - str. - * `-` _tool\_id_ - str. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_agent\_tool( agent\_id="agent\_id", tool\_id="tool\_id", ) - -#### Signature - -```python -def delete_agent_tool(self, agent_id: str, tool_id: str) -> None: ... -``` - -### JulepApi().delete\_session - -[Show source in client.py:406](../../../julep/api/client.py#L406) - -#### Arguments - -``` -- `-` *session_id* - str. -``` - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_session( session\_id="session\_id", ) - -#### Signature - -```python -def delete_session(self, session_id: str) -> None: ... -``` - -### JulepApi().delete\_user - -[Show source in client.py:805](../../../julep/api/client.py#L805) - -#### Arguments - -``` -- `-` *user_id* - str. -``` - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_user( user\_id="user\_id", ) - -#### Signature - -```python -def delete_user(self, user_id: str) -> None: ... -``` - -### JulepApi().delete\_user\_doc - -[Show source in client.py:1134](../../../julep/api/client.py#L1134) - -#### Arguments - -* `-` _user\_id_ - str. - * `-` _doc\_id_ - str. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.delete\_user\_doc( user\_id="user\_id", doc\_id="doc\_id", ) - -#### Signature - -```python -def delete_user_doc(self, user_id: str, doc_id: str) -> None: ... -``` - -### JulepApi().get\_agent - -[Show source in client.py:837](../../../julep/api/client.py#L837) - -#### Arguments - -``` -- `-` *agent_id* - str. -``` - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_agent( agent\_id="agent\_id", ) - -#### Signature - -```python -def get_agent(self, agent_id: str) -> Agent: ... -``` - -### JulepApi().get\_agent\_docs - -[Show source in client.py:964](../../../julep/api/client.py#L964) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_agent\_docs( agent\_id="agent\_id", ) - -#### Signature - -```python -def get_agent_docs( - self, - agent_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetAgentDocsResponse: ... -``` - -### JulepApi().get\_agent\_memories - -[Show source in client.py:663](../../../julep/api/client.py#L663) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _query_ - str. -* `-` _types_ - typing.Optional\[typing.Union\[str, typing.List\[str]]]. episode, belief, entity -* `-` _user\_id_ - typing.Optional\[str]. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_agent\_memories( agent\_id="agent\_id", query="query", ) - -#### Signature - -```python -def get_agent_memories( - self, - agent_id: str, - query: str, - types: typing.Optional[typing.Union[str, typing.List[str]]] = None, - user_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetAgentMemoriesResponse: ... -``` - -### JulepApi().get\_agent\_tools - -[Show source in client.py:1242](../../../julep/api/client.py#L1242) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_agent\_tools( agent\_id="agent\_id", ) - -#### Signature - -```python -def get_agent_tools( - self, - agent_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetAgentToolsResponse: ... -``` - -### JulepApi().get\_history - -[Show source in client.py:482](../../../julep/api/client.py#L482) - -Sorted (created\_at ascending) - -#### Arguments - -* `-` _session\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_history( session\_id="session\_id", ) - -#### Signature - -```python -def get_history( - self, - session_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetHistoryResponse: ... -``` - -### JulepApi().get\_session - -[Show source in client.py:336](../../../julep/api/client.py#L336) - -#### Arguments - -``` -- `-` *session_id* - str. -``` - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_session( session\_id="session\_id", ) - -#### Signature - -```python -def get_session(self, session_id: str) -> Session: ... -``` - -### JulepApi().get\_suggestions - -[Show source in client.py:438](../../../julep/api/client.py#L438) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _session\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_suggestions( session\_id="session\_id", ) - -#### Signature - -```python -def get_suggestions( - self, - session_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetSuggestionsResponse: ... -``` - -### JulepApi().get\_user - -[Show source in client.py:725](../../../julep/api/client.py#L725) - -#### Arguments - -``` -- `-` *user_id* - str. -``` - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_user( user\_id="user\_id", ) - -#### Signature - -```python -def get_user(self, user_id: str) -> User: ... -``` - -### JulepApi().get\_user\_docs - -[Show source in client.py:1049](../../../julep/api/client.py#L1049) - -Sorted (created\_at descending) - -#### Arguments - -* `-` _user\_id_ - str. -* `-` _limit_ - typing.Optional\[int]. - * `-` _offset_ - typing.Optional\[int]. - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.get\_user\_docs( user\_id="user\_id", ) - -#### Signature - -```python -def get_user_docs( - self, - user_id: str, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, -) -> GetUserDocsResponse: ... -``` - -### JulepApi().list\_agents - -[Show source in client.py:231](../../../julep/api/client.py#L231) - -List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -#### Arguments - -* `-` _limit_ - typing.Optional\[int]. Number of items to return - * `-` _offset_ - typing.Optional\[int]. Number of items to skip (sorted created\_at descending order) - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.list\_agents() - -#### Signature - -```python -def list_agents( - self, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None -) -> ListAgentsResponse: ... -``` - -### JulepApi().list\_sessions - -[Show source in client.py:67](../../../julep/api/client.py#L67) - -List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -#### Arguments - -* `-` _limit_ - typing.Optional\[int]. Number of sessions to return - * `-` _offset_ - typing.Optional\[int]. Number of sessions to skip (sorted created\_at descending order) - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.list\_sessions() - -#### Signature - -```python -def list_sessions( - self, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None -) -> ListSessionsResponse: ... -``` - -### JulepApi().list\_users - -[Show source in client.py:148](../../../julep/api/client.py#L148) - -List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at`) - -#### Arguments - -* `-` _limit_ - typing.Optional\[int]. Number of items to return - * `-` _offset_ - typing.Optional\[int]. Number of items to skip (sorted created\_at descending order) - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.list\_users() - -#### Signature - -```python -def list_users( - self, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None -) -> ListUsersResponse: ... -``` - -### JulepApi().update\_agent - -[Show source in client.py:869](../../../julep/api/client.py#L869) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _about_ - typing.Optional\[str]. About the agent -* `-` _instructions_ - typing.Optional\[typing.List\[Instruction]]. List of instructions for the agent -* `-` _name_ - typing.Optional\[str]. Name of the agent -* `-` _model_ - typing.Optional\[str]. Name of the model that the agent is supposed to use - * `-` _default\_settings_ - typing.Optional\[AgentDefaultSettings]. Default model settings to start every session with - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.update\_agent( agent\_id="agent\_id", ) - -#### Signature - -```python -def update_agent( - self, - agent_id: str, - about: typing.Optional[str] = OMIT, - instructions: typing.Optional[typing.List[str]] = OMIT, - name: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, -) -> ResourceUpdatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) - -### JulepApi().update\_agent\_tool - -[Show source in client.py:1332](../../../julep/api/client.py#L1332) - -#### Arguments - -* `-` _agent\_id_ - str. -* `-` _tool\_id_ - str. - * `-` _function_ - FunctionDef. Function definition and parameters - -*** - -from julep import FunctionDef from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.update\_agent\_tool( agent\_id="agent\_id", tool\_id="tool\_id", function=FunctionDef( name="name", parameters={}, ), ) - -#### Signature - -```python -def update_agent_tool( - self, agent_id: str, tool_id: str, function: FunctionDef -) -> ResourceUpdatedResponse: ... -``` - -### JulepApi().update\_session - -[Show source in client.py:368](../../../julep/api/client.py#L368) - -#### Arguments - -* `-` _session\_id_ - str. - * `-` _situation_ - str. Updated situation for this session - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.update\_session( session\_id="session\_id", situation="situation", ) - -#### Signature - -```python -def update_session(self, session_id: str, situation: str) -> ResourceUpdatedResponse: ... -``` - -### JulepApi().update\_user - -[Show source in client.py:757](../../../julep/api/client.py#L757) - -#### Arguments - -* `-` _user\_id_ - str. -* `-` _about_ - typing.Optional\[str]. About the user - * `-` _name_ - typing.Optional\[str]. Name of the user - -*** - -from julep.client import JulepApi - -client = JulepApi( api\_key="YOUR\_API\_KEY", ) client.update\_user( user\_id="user\_id", ) - -#### Signature - -```python -def update_user( - self, - user_id: str, - about: typing.Optional[str] = OMIT, - name: typing.Optional[str] = OMIT, -) -> ResourceUpdatedResponse: ... -``` - -#### See also - -* [OMIT](client-1.md#omit) diff --git a/docs/sdks/python-sdk-docs/client.md b/docs/sdks/python-sdk-docs/client.md deleted file mode 100644 index 747d4d462..000000000 --- a/docs/sdks/python-sdk-docs/client.md +++ /dev/null @@ -1,87 +0,0 @@ -# Client - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / Client - -> Auto-generated documentation for [julep.client](../../../julep/client.py) module. - -* [Client](client.md#client) - * [AsyncClient](client.md#asyncclient) - * [Client](client.md#client-1) - -## AsyncClient - -[Show source in client.py:122](../../../julep/client.py#L122) - -A class representing an asynchronous client for interacting with various managers. - -This class initializes asynchronous managers for agents, users, sessions, documents, memories, and tools. It requires an API key and a base URL to establish a connection with the backend service. If these are not explicitly provided, it looks for them in the environment variables. - -#### Attributes - -* `agents` _AsyncAgentsManager_ - Manager for handling agent-related interactions. -* `users` _AsyncUsersManager_ - Manager for handling user-related interactions. -* `sessions` _AsyncSessionsManager_ - Manager for handling session-related interactions. -* `docs` _AsyncDocsManager_ - Manager for handling document-related interactions. -* `memories` _AsyncMemoriesManager_ - Manager for handling memory-related interactions. -* `tools` _AsyncToolsManager_ - Manager for handling tool-related interactions. -* `chat` _AsyncChat_ - A chat manager instance for handling chat interactions (based on OpenAI client). -* `completions` _AsyncCompletions_ - A manager instance for handling completions (based on OpenAI client). - -#### Raises - -* `AssertionError` - If `api_key` or `base_url` is not provided and also not set as an environment variable. - -#### Notes - -The `api_key` and `base_url` can either be passed explicitly or set as environment variables `JULEP_API_KEY` and `JULEP_API_URL`, respectively. - -#### Arguments - -* `api_key` _Optional\[str]_ - The API key required to authenticate with the service. Defaults to the value of the `JULEP_API_KEY` environment variable. -* `base_url` _Optional\[str]_ - The base URL of the API service. Defaults to the value of the `JULEP_API_URL` environment variable. -* `*args` - Variable length argument list. -* `**kwargs` - Arbitrary keyword arguments. - -#### Signature - -```python -class AsyncClient: - @beartype - def __init__( - self, - api_key: Optional[str] = JULEP_API_KEY, - base_url: Optional[str] = JULEP_API_URL, - *args, - **kwargs - ): ... -``` - -## Client - -[Show source in client.py:27](../../../julep/client.py#L27) - -A class that encapsulates managers for different aspects of a system and provides an interface for interacting with an API. - -This class initializes and makes use of various manager classes to handle agents, users, sessions, documents, memories, and tools. It requires an API key and a base URL to initialize the API client that the managers will use. - -Attributes: agents (AgentsManager): A manager instance for handling agents. users (UsersManager): A manager instance for handling users. sessions (SessionsManager): A manager instance for handling sessions. docs (DocsManager): A manager instance for handling documents. memories (MemoriesManager): A manager instance for handling memories. tools (ToolsManager): A manager instance for handling tools. chat (Chat): A chat manager instance for handling chat interactions (based on OpenAI client). completions (Completions): A manager instance for handling completions (based on OpenAI client). - -Args: api\_key (Optional\[str]): The API key needed to authenticate with the API. Defaults to the JULEP\_API\_KEY environment variable. base\_url (Optional\[str]): The base URL for the API endpoints. Defaults to the JULEP\_API\_URL environment variable. \*args: Variable length argument list. \*\*kwargs: Arbitrary keyword arguments. - -Raises: AssertionError: If either `api_key` or `base_url` is not provided and not set as an environment variable. - -Note: `beartype` decorator is expected to ensure type checking on the parameters during runtime. The constants `JULEP_API_KEY` and `JULEP_API_URL` should be predefined and represent default values for the API key and base URL, respectively, which can be overridden by providing a value at instantiation. - -#### Signature - -```python -class Client: - @beartype - def __init__( - self, - api_key: Optional[str] = JULEP_API_KEY, - base_url: Optional[str] = JULEP_API_URL, - *args, - **kwargs - ): ... -``` diff --git a/docs/sdks/python-sdk-docs/doc.md b/docs/sdks/python-sdk-docs/doc.md deleted file mode 100644 index f5e47aeae..000000000 --- a/docs/sdks/python-sdk-docs/doc.md +++ /dev/null @@ -1,429 +0,0 @@ -# Docs - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Managers](../../python-sdk-docs/julep/managers/index.md#managers) / Doc - -> Auto-generated documentation for [julep.managers.doc](../../../julep/managers/doc.py) module. - -* [Doc](doc.md#doc) - * [AsyncDocsManager](doc.md#asyncdocsmanager) - * [BaseDocsManager](doc.md#basedocsmanager) - * [DocsManager](doc.md#docsmanager) - -## AsyncDocsManager - -[Show source in doc.py:327](../../../julep/managers/doc.py#L327) - -A class for managing asynchronous operations on documents. - -Inherits from BaseDocsManager to provide async document retrieval, creation, and deletion. - -#### Attributes - -Inherited from BaseDocsManager. - -#### Methods - -async get(self, \*, agent\_id: Optional\[Union\[str, UUID]] = None, user\_id: Optional\[Union\[str, UUID]] = None, limit: Optional\[int] = None, offset: Optional\[int] = None) -> List\[Doc]: Asynchronously get a list of documents, with optional filtering based on agent\_id, user\_id, and pagination options limit and offset. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The agent's identifier to filter documents. user\_id (Optional\[Union\[str, UUID]]): The user's identifier to filter documents. - -* `limit` _Optional\[int]_ - The maximum number of documents to return. -* `offset` _Optional\[int]_ - The offset from where to start returning documents. agent\_id (Optional\[Union\[str, UUID]]): The agent's identifier associated with the document. user\_id (Optional\[Union\[str, UUID]]): The user's identifier associated with the document. -* `doc` _DocDict_ - The document data to be created. doc\_id (Union\[str, UUID]): The unique identifier of the document to be deleted. agent\_id (Optional\[Union\[str, UUID]]): The agent's identifier associated with the document, if applicable. user\_id (Optional\[Union\[str, UUID]]): The user's identifier associated with the document, if applicable. - -#### Returns - -* `List[Doc]` - A list of documents. - -async create(self, \*, agent\_id: Optional\[Union\[str, UUID]] = None, user\_id: Optional\[Union\[str, UUID]] = None, doc: DocDict) -> ResourceCreatedResponse: Asynchronously create a new document with the given document information, and optional agent\_id and user\_id. - `ResourceCreatedResponse` - A response object indicating successful creation of the document. - -async delete(self, \*, doc\_id: Union\[str, UUID], agent\_id: Optional\[Union\[str, UUID]] = None, user\_id: Optional\[Union\[str, UUID]] = None): Asynchronously delete a document by its id, with optional association to a specific agent\_id or user\_id. - -#### Notes - -The `@beartype` decorator is being used to perform runtime type checking on the function arguments. - -#### Signature - -```python -class AsyncDocsManager(BaseDocsManager): ... -``` - -#### See also - -* [BaseDocsManager](doc.md#basedocsmanager) - -### AsyncDocsManager().create - -[Show source in doc.py:406](../../../julep/managers/doc.py#L406) - -Create a new resource asynchronously. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The ID of the agent. Default is None. user\_id (Optional\[Union\[str, UUID]]): The ID of the user. Default is None. - -* `doc` _DocDict_ - A dictionary containing document data. - -#### Returns - -* `ResourceCreatedResponse` - An object representing the response for a resource created. - -#### Raises - -* `BeartypeException` - If any of the input arguments do not match their expected types. This is implicitly raised due to the use of the beartype decorator. - -#### Signature - -```python -@beartype -async def create( - self, - agent_id: Optional[Union[str, UUID]] = None, - user_id: Optional[Union[str, UUID]] = None, - doc: DocDict, -) -> ResourceCreatedResponse: ... -``` - -### AsyncDocsManager().delete - -[Show source in doc.py:434](../../../julep/managers/doc.py#L434) - -Asynchronously deletes a document by its ID. - -This function is a coroutine and must be awaited. - -#### Arguments - -doc\_id (Union\[str, UUID]): The unique identifier of the document to delete. agent\_id (Optional\[Union\[str, UUID]]): The unique identifier of the agent, if any. user\_id (Optional\[Union\[str, UUID]]): The unique identifier of the user, if any. - -#### Returns - -* `Coroutine[Any]` - A coroutine that, when awaited, returns the result of the document deletion process. - -#### Notes - -The `@beartype` decorator is used to enforce type checking on the function arguments. - -#### Signature - -```python -@beartype -async def delete( - self, - doc_id: Union[str, UUID], - agent_id: Optional[Union[str, UUID]] = None, - user_id: Optional[Union[str, UUID]] = None, -): ... -``` - -### AsyncDocsManager().get - -[Show source in doc.py:367](../../../julep/managers/doc.py#L367) - -Asynchronously get a list of documents. - -This function fetches documents based on the provided filtering criteria such as `agent_id`, `user_id`, and supports pagination through `limit` and `offset`. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The ID of the agent to filter documents by. Default is None. user\_id (Optional\[Union\[str, UUID]]): The ID of the user to filter documents by. Default is None. - -* `limit` _Optional\[int]_ - The maximum number of documents to return. Default is None. -* `offset` _Optional\[int]_ - The offset from where to start the document retrieval. Default is None. - -#### Returns - -* `List[Doc]` - A list of document objects. - -#### Notes - -The `@beartype` decorator is used to ensure that arguments conform to the expected types. - -#### Raises - -* `BeartypeDecorHintPepParamException` - If any of the parameters do not adhere to the declared types. - -#### Signature - -```python -@beartype -async def get( - self, - agent_id: Optional[Union[str, UUID]] = None, - user_id: Optional[Union[str, UUID]] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Doc]: ... -``` - -## BaseDocsManager - -[Show source in doc.py:19](../../../julep/managers/doc.py#L19) - -Manages documents for agents or users by providing methods to get, create, and delete docsrmation. - -The class utilizes an API client to interact with a back-end service that handles the document management operations. - -Typical usage example: - -docs\_manager = BaseDocsManager(api\_client) agent\_docs = docs\_manager.\_get(agent\_id="some-agent-uuid") user\_docs = docs\_manager.\_get(user\_id="some-user-uuid") created\_doc = docs\_manager.\_create(agent\_id="some-agent-uuid", doc={"key": "value"}) docs\_manager.\_delete(user\_id="some-user-uuid", doc\_id="some-doc-uuid") - -#### Attributes - -* `api_client` - A client instance used to make API calls to the document management system. - -#### Methods - -* `_get(agent_id` - Optional\[Union\[str, UUID]], user\_id: Optional\[Union\[str, UUID]], - * `limit` - Optional\[int]=None, offset: Optional\[int]=None) -> Union\[GetAgentDocsResponse, Awaitable\[GetAgentDocsResponse]] Retrieves docsrmation for either an agent or user. Must provide exactly one valid UUID v4 for either `agent_id` or `user_id`. -* `_create(agent_id` - Optional\[Union\[str, UUID]], user\_id: Optional\[Union\[str, UUID]], doc: DocDict) -> Union\[ResourceCreatedResponse, Awaitable\[ResourceCreatedResponse]] Creates docsrmation for either an agent or user. Must provide exactly one valid UUID v4 for either `agent_id` or `user_id`. The `doc` parameter contains the document information to be created. -* `_delete(agent_id` - Optional\[Union\[str, UUID]], user\_id: Optional\[Union\[str, UUID]], doc\_id: Union\[str, UUID]): Deletes docsrmation for either an agent or user. Must provide exactly one valid UUID v4 for either `agent_id` or `user_id`, and a valid UUID for `doc_id`. - -#### Signature - -```python -class BaseDocsManager(BaseManager): ... -``` - -### BaseDocsManager().\_create - -[Show source in doc.py:98](../../../julep/managers/doc.py#L98) - -Create a new resource with docsrmation for either an agent or a user, but not both. - -This function asserts that exactly one of `agent_id` or `user_id` is provided and is a valid UUID v4. It then creates the appropriate docsrmation based on which ID was provided. - -Args: agent\_id (Optional\[Union\[str, UUID]]): The UUID of the agent or None. user\_id (Optional\[Union\[str, UUID]]): The UUID of the user or None. doc (DocDict): A dictionary containing the document data for the resource being created. - -Returns: Union\[ResourceCreatedResponse, Awaitable\[ResourceCreatedResponse]]: The response after creating the resource, which could be immediate or an awaitable for asynchronous execution. - -Raises: AssertionError: If both `agent_id` and `user_id` are provided, neither are provided, or if the provided IDs are not valid UUID v4 strings. - -Note: One and only one of `agent_id` or `user_id` must be provided and must be a valid UUID v4. The `DocDict` type should be a dictionary compatible with the `CreateDoc` schema. - -#### Signature - -```python -def _create( - self, - agent_id: Optional[Union[str, UUID]], - user_id: Optional[Union[str, UUID]], - doc: DocDict, -) -> Union[ResourceCreatedResponse, Awaitable[ResourceCreatedResponse]]: ... -``` - -### BaseDocsManager().\_delete - -[Show source in doc.py:145](../../../julep/managers/doc.py#L145) - -Delete docs based on either an agent\_id or a user\_id. - -This method selects the appropriate deletion operation (agent or user) based on whether an `agent_id` or `user_id` is provided. Only one of these ID types should be valid and provided. - -Args: agent\_id (Optional\[Union\[str, UUID]]): A unique identifier of an agent. Either a string or UUID v4, but not both `agent_id` and `user_id`. user\_id (Optional\[Union\[str, UUID]]): A unique identifier of a user. Either a string or UUID v4, but not both `agent_id` and `user_id`. doc\_id (Union\[str, UUID]): A unique identifier for docsrmation to be deleted, as a string or UUID v4. - -Returns: The result of the API deletion request. This can be the response object from the client's delete operation. - -Raises: AssertionError: If neither `agent_id` nor `user_id` is valid, if both are provided simultaneously, or if negation logic for valid UUIDs fails. Other exceptions related to the `api_client` operations could potentially be raised and depend on its implementation. - -#### Signature - -```python -def _delete( - self, - agent_id: Optional[Union[str, UUID]], - user_id: Optional[Union[str, UUID]], - doc_id: Union[str, UUID], -): ... -``` - -### BaseDocsManager().\_get - -[Show source in doc.py:52](../../../julep/managers/doc.py#L52) - -Retrieve docsrmation for an agent or user based on their ID. - -This internal method fetches docsrmation for either an agent or a user, but not both. If both or neither `agent_id` and `user_id` are provided, it will assert an error. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The UUID v4 of the agent for whom docs is requested, exclusive with `user_id`. user\_id (Optional\[Union\[str, UUID]]): The UUID v4 of the user for whom docs is requested, exclusive with `agent_id`. - -* `limit` _Optional\[int]_ - The maximum number of records to return. Defaults to None. -* `offset` _Optional\[int]_ - The number of records to skip before starting to collect the response set. Defaults to None. - -#### Returns - -* `Union[GetAgentDocsResponse,` _Awaitable\[GetAgentDocsResponse]]_ - The response object containing docsrmation about the agent or user, or a promise of such an object if the call is asynchronous. - -#### Raises - -* `AssertionError` - If both `agent_id` and `user_id` are provided or neither is provided, or if the provided IDs are not valid UUID v4. - -#### Signature - -```python -def _get( - self, - agent_id: Optional[Union[str, UUID]], - user_id: Optional[Union[str, UUID]], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> Union[GetAgentDocsResponse, Awaitable[GetAgentDocsResponse]]: ... -``` - -## DocsManager - -[Show source in doc.py:187](../../../julep/managers/doc.py#L187) - -A class responsible for managing documents. - -This class provides methods for retrieving, creating, and deleting documents. It uses a base document management system to perform operations. - -#### Attributes - -None specific to this class, as all are inherited from BaseDocsManager. - -#### Methods - -get: Retrieves a list of documents according to specified filters. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The agent's identifier to filter documents by, if any. user\_id (Optional\[Union\[str, UUID]]): The user's identifier to filter documents by, if any. - -* `limit` _Optional\[int]_ - The maximum number of documents to be retrieved. -* `offset` _Optional\[int]_ - The number of documents to skip before starting to collect the document output list. - -agent\_id (Optional\[Union\[str, UUID]]): The agent's identifier associated with the document, if any. user\_id (Optional\[Union\[str, UUID]]): The user's identifier associated with the document, if any. - -* `doc` _DocDict_ - The document to be created represented as a dictionary of document metadata. - -doc\_id (Union\[str, UUID]): The identifier of the document to be deleted. agent\_id (Optional\[Union\[str, UUID]]): The agent's identifier associated with the document, if any. user\_id (Optional\[Union\[str, UUID]]): The user's identifier associated with the document, if any. - -#### Returns - -* `List[Doc]` - A list of documents matching the provided filters. - -create: Creates a new document. - -* `ResourceCreatedResponse` - An object representing the creation response, typically containing the ID of the created document. - -delete: Deletes a document by its document identifier. - -None, but the method may raise exceptions on failure. - -#### Signature - -```python -class DocsManager(BaseDocsManager): ... -``` - -#### See also - -* [BaseDocsManager](doc.md#basedocsmanager) - -### DocsManager().create - -[Show source in doc.py:265](../../../julep/managers/doc.py#L265) - -Create a new resource with the specified document. - -This method wraps a call to an internal '\_create' method, passing along any specified agent or user identifiers, along with the document data. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The agent identifier associated with the resource creation. user\_id (Optional\[Union\[str, UUID]]): The user identifier associated with the resource creation. - -* `doc` _DocDict_ - A dictionary containing the document data. - -#### Returns - -* `ResourceCreatedResponse` - An object representing the response for the resource creation operation. - -#### Raises - -* `BeartypeException` - If any input parameters are of incorrect type, due to type enforcement by the @beartype decorator. - -#### Signature - -```python -@beartype -def create( - self, - agent_id: Optional[Union[str, UUID]] = None, - user_id: Optional[Union[str, UUID]] = None, - doc: DocDict, -) -> ResourceCreatedResponse: ... -``` - -### DocsManager().delete - -[Show source in doc.py:296](../../../julep/managers/doc.py#L296) - -Deletes a document by its identifier. - -This function wraps the internal \_delete method, providing an interface to delete documents by their ID while optionally specifying the agent ID and user ID. - -#### Arguments - -doc\_id (Union\[str, UUID]): The unique identifier of the document to be deleted. agent\_id (Optional\[Union\[str, UUID]]): The unique identifier of the agent performing the delete operation, if any. user\_id (Optional\[Union\[str, UUID]]): The unique identifier of the user performing the delete operation, if any. - -#### Returns - -The return type depends on the implementation of the `_delete` method. - -#### Raises - -The exceptions raised depend on the implementation of the `_delete` method. - -#### Signature - -```python -@beartype -def delete( - self, - doc_id: Union[str, UUID], - agent_id: Optional[Union[str, UUID]] = None, - user_id: Optional[Union[str, UUID]] = None, -): ... -``` - -### DocsManager().get - -[Show source in doc.py:232](../../../julep/managers/doc.py#L232) - -Retrieve a list of documents based on specified criteria. - -This method supports filtering the documents by agent\_id or user\_id, and also supports pagination through the limit and offset parameters. - -#### Arguments - -agent\_id (Optional\[Union\[str, UUID]]): The unique identifier for the agent. Can be a string or a UUID object. Default is None, which means no filtering by agent\_id is applied. user\_id (Optional\[Union\[str, UUID]]): The unique identifier for the user. Can be a string or a UUID object. Default is None, which means no filtering by user\_id is applied. - -* `limit` _Optional\[int]_ - The maximum number of documents to retrieve. Default is None, which means no limit is applied. -* `offset` _Optional\[int]_ - The number of documents to skip before starting to collect the document list. Default is None, which means no offset is applied. - -#### Returns - -* `List[Doc]` - A list of documents that match the provided criteria. - -#### Notes - -The `@beartype` decorator is used to ensure that the input arguments are of the expected types. If an argument is passed that does not match the expected type, a type error will be raised. - -#### Signature - -```python -@beartype -def get( - self, - agent_id: Optional[Union[str, UUID]] = None, - user_id: Optional[Union[str, UUID]] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Doc]: ... -``` diff --git a/docs/sdks/python-sdk-docs/memory.md b/docs/sdks/python-sdk-docs/memory.md deleted file mode 100644 index c95be8690..000000000 --- a/docs/sdks/python-sdk-docs/memory.md +++ /dev/null @@ -1,190 +0,0 @@ -# Memories - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Managers](../../python-sdk-docs/julep/managers/index.md#managers) / Memory - -> Auto-generated documentation for [julep.managers.memory](../../../julep/managers/memory.py) module. - -* [Memory](memory.md#memory) - * [AsyncMemoriesManager](memory.md#asyncmemoriesmanager) - * [BaseMemoriesManager](memory.md#basememoriesmanager) - * [MemoriesManager](memory.md#memoriesmanager) - -## AsyncMemoriesManager - -[Show source in memory.py:135](../../../julep/managers/memory.py#L135) - -Asynchronously lists memories based on various filter parameters. - -Args: agent\_id (Union\[str, UUID]): The unique identifier of the agent. query (str): The search query string to filter memories. types (Optional\[Union\[str, List\[str]]], optional): The types of memories to filter by. Defaults to None. user\_id (Optional\[str], optional): The unique identifier of the user. Defaults to None. limit (Optional\[int], optional): The maximum number of memories to return. Defaults to None. offset (Optional\[int], optional): The number of memories to skip before starting to collect the result set. Defaults to None. - -Returns: List\[Memory]: A list of Memory objects that match the given filters. - -Raises: ValidationError: If the input validation fails. DatabaseError: If there is a problem accessing the database. - -#### Signature - -```python -class AsyncMemoriesManager(BaseMemoriesManager): ... -``` - -#### See also - -* [BaseMemoriesManager](memory.md#basememoriesmanager) - -### AsyncMemoriesManager().list - -[Show source in memory.py:155](../../../julep/managers/memory.py#L155) - -Asynchronously list memories based on query parameters. - -#### Arguments - -agent\_id (Union\[str, UUID]): The ID of the agent to list memories for. - -* `query` _str_ - The query string to filter memories. types (Optional\[Union\[str, List\[str]]], optional): The types of memories to retrieve. Defaults to None. -* `user_id` _Optional\[str], optional_ - The ID of the user to list memories for. Defaults to None. -* `limit` _Optional\[int], optional_ - The maximum number of memories to return. Defaults to None. -* `offset` _Optional\[int], optional_ - The offset to start listing memories from. Defaults to None. - -#### Returns - -* `List[Memory]` - A list of Memory objects that match the query. - -#### Notes - -`@beartype` decorator is used for runtime type checking. - -#### Signature - -```python -@beartype -async def list( - self, - agent_id: Union[str, UUID], - query: str, - types: Optional[Union[str, List[str]]] = None, - user_id: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Memory]: ... -``` - -## BaseMemoriesManager - -[Show source in memory.py:16](../../../julep/managers/memory.py#L16) - -A base manager class for handling agent memories. - -This manager provides an interface to interact with agent memories, allowing for listing and other operations to manage an agent's memories. - -Methods: \_list(agent\_id, query, types=None, user\_id=None, limit=None, offset=None): Retrieves a list of memories for a given agent. - -Args: agent\_id (str): A valid UUID v4 string identifying the agent. query (str): The query string to search memories. types (Optional\[Union\[str, List\[str]]]): The type(s) of memories to retrieve. user\_id (Optional\[str]): The user identifier associated with the memories. limit (Optional\[int]): The maximum number of memories to retrieve. offset (Optional\[int]): The number of initial memories to skip in the result set. - -Returns: Union\[GetAgentMemoriesResponse, Awaitable\[GetAgentMemoriesResponse]]: A synchronous or asynchronous response object containing the list of agent memories. - -Raises: AssertionError: If `agent_id` is not a valid UUID v4. - -#### Signature - -```python -class BaseMemoriesManager(BaseManager): ... -``` - -### BaseMemoriesManager().\_list - -[Show source in memory.py:43](../../../julep/managers/memory.py#L43) - -List memories from a given agent based on a query and further filtering options. - -#### Arguments - -* `agent_id` _str_ - A valid UUID v4 representing the agent ID. -* `query` _str_ - Query string to filter memories. types (Optional\[Union\[str, List\[str]]], optional): The types of memories to filter. -* `user_id` _Optional\[str], optional_ - The user ID to filter memories. -* `limit` _Optional\[int], optional_ - The maximum number of memories to return. -* `offset` _Optional\[int], optional_ - The number of memories to skip before starting to collect the result set. - -#### Returns - -* `Union[GetAgentMemoriesResponse,` _Awaitable\[GetAgentMemoriesResponse]]_ - Returns a synchronous or asynchronous response with the agent memories. - -#### Raises - -* `AssertionError` - If `agent_id` is not a valid UUID v4. - -#### Signature - -```python -def _list( - self, - agent_id: str, - query: str, - types: Optional[Union[str, List[str]]] = None, - user_id: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> Union[GetAgentMemoriesResponse, Awaitable[GetAgentMemoriesResponse]]: ... -``` - -## MemoriesManager - -[Show source in memory.py:81](../../../julep/managers/memory.py#L81) - -A class for managing memory entities associated with agents. - -This class inherits from [BaseMemoriesManager](memory.md#basememoriesmanager) and provides an interface to list memory entities for a given agent. - -Attributes: Inherited from [BaseMemoriesManager](memory.md#basememoriesmanager). - -Methods: list: Retrieves a list of memory entities based on query parameters. - -#### Signature - -```python -class MemoriesManager(BaseMemoriesManager): ... -``` - -#### See also - -* [BaseMemoriesManager](memory.md#basememoriesmanager) - -### MemoriesManager().list - -[Show source in memory.py:95](../../../julep/managers/memory.py#L95) - -List memories meeting specified criteria. - -This function fetches a list of Memory objects based on various filters and parameters such as agent\_id, query, types, user\_id, limit, and offset. - -#### Arguments - -agent\_id (Union\[str, UUID]): The unique identifier for the agent. - -* `query` _str_ - The search term used to filter memories. types (Optional\[Union\[str, List\[str]]], optional): The types of memories to retrieve. Can be a single type as a string or a list of types. Default is None, which does not filter by type. -* `user_id` _Optional\[str], optional_ - The unique identifier for the user. If provided, only memories associated with this user will be retrieved. Default is None. -* `limit` _Optional\[int], optional_ - The maximum number of memories to return. Default is None, which means no limit. -* `offset` _Optional\[int], optional_ - The number of memories to skip before starting to return the results. Default is None. - -#### Returns - -* `List[Memory]` - A list of Memory objects that match the given criteria. - -#### Notes - -The `@beartype` decorator is used to ensure that arguments conform to the expected types at runtime. - -#### Signature - -```python -@beartype -def list( - self, - agent_id: Union[str, UUID], - query: str, - types: Optional[Union[str, List[str]]] = None, - user_id: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Memory]: ... -``` diff --git a/docs/sdks/python-sdk-docs/session.md b/docs/sdks/python-sdk-docs/session.md deleted file mode 100644 index 40ec2c9cb..000000000 --- a/docs/sdks/python-sdk-docs/session.md +++ /dev/null @@ -1,958 +0,0 @@ -# Sessions - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Managers](../../python-sdk-docs/julep/managers/index.md#managers) / Session - -> Auto-generated documentation for [julep.managers.session](../../../julep/managers/session.py) module. - -* [Session](session.md#session) - * [AsyncSessionsManager](session.md#asyncsessionsmanager) - * [BaseSessionsManager](session.md#basesessionsmanager) - * [SessionsManager](session.md#sessionsmanager) - -## AsyncSessionsManager - -[Show source in session.py:688](../../../julep/managers/session.py#L688) - -A class for managing asynchronous sessions. - -This class handles operations related to creating, retrieving, updating, deleting, and interacting with sessions asynchronously. It extends the functionality of BaseSessionsManager with asynchronous behavior. - -#### Attributes - -Inherits attributes from the BaseSessionsManager class. - -#### Methods - -* `async` _get(id_ - Union\[UUID, str]) -> Session: Retrieves a session by its ID. - -async create(\*, user\_id: Union\[str, UUID], agent\_id: Union\[str, UUID], situation: Optional\[str]=None) -> ResourceCreatedResponse: Creates a new session with the specified user and agent IDs, and an optional situation. - -async list(\*, limit: Optional\[int]=None, offset: Optional\[int]=None) -> List\[Session]: Lists sessions with an optional limit and offset for pagination. - -* `async` _delete(session\_id_ - Union\[str, UUID]): Deletes a session by its ID. - -async update(\*, session\_id: Union\[str, UUID], situation: str) -> ResourceUpdatedResponse: Updates the situation for a session by its ID. - -async chat(\*, session\_id: str, messages: List\[InputChatMlMessage], tools: Optional\[List\[Tool]]=None, tool\_choice: Optional\[ToolChoiceOption]=None, frequency\_penalty: Optional\[float]=None, length\_penalty: Optional\[float]=None, logit\_bias: Optional\[Dict\[str, Optional\[int]]]=None, max\_tokens: Optional\[int]=None, presence\_penalty: Optional\[float]=None, repetition\_penalty: Optional\[float]=None, response\_format: Optional\[ChatSettingsResponseFormat]=None, seed: Optional\[int]=None, stop: Optional\[ChatSettingsStop]=None, stream: Optional\[bool]=None, temperature: Optional\[float]=None, top\_p: Optional\[float]=None, recall: Optional\[bool]=None, remember: Optional\[bool]=None) -> ChatResponse: Initiates a chat session with given messages and optional parameters for the chat behavior and output. - -async suggestions(\*, session\_id: Union\[str, UUID], limit: Optional\[int]=None, offset: Optional\[int]=None) -> List\[Suggestion]: Retrieves suggestions related to a session optionally limited and paginated. - -async history(\*, session\_id: Union\[str, UUID], limit: Optional\[int]=None, offset: Optional\[int]=None) -> List\[ChatMlMessage]: Retrieves the history of messages in a session, optionally limited and paginated. - -#### Notes - -The `@beartype` decorator is used for runtime type checking of the arguments. - -Additional methods may be provided by the BaseSessionsManager. - -#### Signature - -```python -class AsyncSessionsManager(BaseSessionsManager): ... -``` - -#### See also - -* [BaseSessionsManager](session.md#basesessionsmanager) - -### AsyncSessionsManager().chat - -[Show source in session.py:869](../../../julep/managers/session.py#L869) - -Sends a message in an asynchronous chat session and retrieves the response. - -This method leverages the messaging interface with various options to adjust the behavior of the chat bot. - -#### Arguments - -* `session_id` _str_ - The unique identifier for the chat session. -* `messages` _List\[InputChatMlMessage]_ - A list of chat messages in the session's context. -* `tools` _Optional\[List\[Tool]]_ - A list of tools, if provided, to enhance the chat capabilities. -* `tool_choice` _Optional\[ToolChoiceOption]_ - A preference for tool selection during the chat. -* `frequency_penalty` _Optional\[float]_ - Adjusts how much the model should avoid repeating the same line of thought. -* `length_penalty` _Optional\[float]_ - Penalizes longer responses. logit\_bias (Optional\[Dict\[str, Optional\[int]]]): Biases the model's prediction towards or away from certain tokens. -* `max_tokens` _Optional\[int]_ - The maximum length of the generated response. -* `presence_penalty` _Optional\[float]_ - Adjusts how much the model should consider new concepts. -* `repetition_penalty` _Optional\[float]_ - Adjusts how much the model should avoid repeating previous input. -* `response_format` _Optional\[ChatSettingsResponseFormat]_ - The desired format for the response. -* `seed` _Optional\[int]_ - A seed used to initialize the model's random number generator. -* `stop` _Optional\[ChatSettingsStop]_ - Tokens that signify the end of the response. -* `stream` _Optional\[bool]_ - Whether or not to stream the responses. -* `temperature` _Optional\[float]_ - Controls randomness in the response generation. -* `top_p` _Optional\[float]_ - Controls diversity via nucleus sampling. -* `recall` _Optional\[bool]_ - If true, the model recalls previous messages within the same session. -* `remember` _Optional\[bool]_ - If true, the model incorporates the context from the previous conversations in the session. - -#### Returns - -* `ChatResponse` - The response from the chat bot, encapsulating the result of the chat action. - -#### Notes - -This function is decorated with `@beartype`, which enforces type annotations at runtime. - -#### Examples - -```python ->>> response = await chat(...) ->>> print(response) -``` - -#### Signature - -```python -@beartype -async def chat( - self, - session_id: str, - messages: List[InputChatMlMessage], - tools: Optional[List[Tool]] = None, - tool_choice: Optional[ToolChoiceOption] = None, - frequency_penalty: Optional[float] = None, - length_penalty: Optional[float] = None, - logit_bias: Optional[Dict[str, Optional[int]]] = None, - max_tokens: Optional[int] = None, - presence_penalty: Optional[float] = None, - repetition_penalty: Optional[float] = None, - response_format: Optional[ChatSettingsResponseFormat] = None, - seed: Optional[int] = None, - stop: Optional[ChatSettingsStop] = None, - stream: Optional[bool] = None, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - recall: Optional[bool] = None, - remember: Optional[bool] = None, -) -> ChatResponse: ... -``` - -### AsyncSessionsManager().create - -[Show source in session.py:758](../../../julep/managers/session.py#L758) - -Asynchronously create a resource with the specified user and agent identifiers. - -This function wraps an internal \_create method and is decorated with `beartype` for run-time type checking. - -#### Arguments - -user\_id (Union\[str, UUID]): Unique identifier for the user. agent\_id (Union\[str, UUID]): Unique identifier for the agent. - -* `situation` _Optional\[str], optional_ - Description of the situation, defaults to None. - -#### Returns - -* `ResourceCreatedResponse` - An object representing the successful creation of the resource. - -#### Raises - -* `BeartypeException` - If any of the input arguments do not match their expected types. Any exception raised by the internal \_create method. - -#### Signature - -```python -@beartype -async def create( - self, - user_id: Union[str, UUID], - agent_id: Union[str, UUID], - situation: Optional[str] = None, -) -> ResourceCreatedResponse: ... -``` - -### AsyncSessionsManager().delete - -[Show source in session.py:815](../../../julep/managers/session.py#L815) - -Asynchronously delete a session given its ID. - -#### Arguments - -session\_id (Union\[str, UUID]): The unique identifier for the session, which can be either a string or a UUID. - -#### Returns - -Coroutine\[Any, Any, Any]: A coroutine that, when awaited, completes the deletion process. - -#### Raises - -The decorators or the body of the '\_delete' method may define specific exceptions that could be raised during the execution. Generally, include any exceptions that are raised by the '\_delete' method or by the 'beartype' decorator in this section. - -#### Signature - -```python -@beartype -async def delete(self, session_id: Union[str, UUID]): ... -``` - -### AsyncSessionsManager().get - -[Show source in session.py:730](../../../julep/managers/session.py#L730) - -Asynchronously get a Session object by its identifier. - -This method retrieves a Session based on the provided `id`. It uses an underlying asynchronous '\_get' method to perform the operation. - -#### Arguments - -id (Union\[UUID, str]): The unique identifier of the Session to retrieve. It can be either a string representation or a UUID object. - -#### Returns - -* `Session` - The retrieved Session object associated with the given id. - -#### Raises - -* `TypeError` - If the `id` is not of type UUID or str. -* `ValueError` - If the `id` is not a valid UUID or an invalid string is provided. -* `AnyExceptionRaisedBy_get` - Descriptive name of specific exceptions that '\_get' might raise, if any. Replace this with the actual exceptions. - -#### Notes - -The `@beartype` decorator is being used to enforce type checking at runtime. This ensures that the argument `id` is of the correct type (UUID or str) and that the return value is a Session object. - -#### Signature - -```python -@beartype -async def get(self, id: Union[UUID, str]) -> Session: ... -``` - -### AsyncSessionsManager().history - -[Show source in session.py:980](../../../julep/managers/session.py#L980) - -Retrieve a history of chat messages based on the session ID, with optional limit and offset. - -This function is decorated with 'beartype' for runtime type checking. - -#### Arguments - -session\_id (Union\[str, UUID]): The unique identifier for the chat session. - -* `limit` _Optional\[int], optional_ - The maximum number of chat messages to return. Defaults to None. -* `offset` _Optional\[int], optional_ - The number of chat messages to skip before starting to collect the history slice. Defaults to None. - -#### Returns - -* `List[ChatMlMessage]` - A list of chat messages from the history that match the criteria. - -#### Raises - -Any exceptions that may be raised by the underlying '\_history' method or 'beartype' decorator. - -#### Signature - -```python -@beartype -async def history( - self, - session_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[ChatMlMessage]: ... -``` - -### AsyncSessionsManager().list - -[Show source in session.py:789](../../../julep/managers/session.py#L789) - -Asynchronously retrieves a list of sessions with optional pagination. - -This method utilizes `_list_items` internally to obtain session data with support for limit and offset parameters. The `beartype` decorator is used to ensure that the function parameters match the expected types. - -#### Arguments - -* `limit` _Optional\[int], optional_ - The maximum number of sessions to retrieve. Default is None, which retrieves all available sessions. -* `offset` _Optional\[int], optional_ - The number to skip before starting to collect the response set. Default is None. - -#### Returns - -* `List[Session]` - A list of `Session` objects containing session data. - -#### Signature - -```python -@beartype -async def list( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> List[Session]: ... -``` - -### AsyncSessionsManager().suggestions - -[Show source in session.py:948](../../../julep/managers/session.py#L948) - -Retrieve a list of suggestions asynchronously. - -This function asynchronously fetches suggestions based on the provided session ID, with optional limit and offset parameters for pagination. - -#### Arguments - -session\_id (Union\[str, UUID]): The session identifier for which suggestions are to be retrieved. - -* `limit` _Optional\[int]_ - The maximum number of suggestions to return. Defaults to None, which means no limit. -* `offset` _Optional\[int]_ - The number of suggestions to skip before starting to return results. Defaults to None, which means no offset. - -#### Returns - -* `List[Suggestion]` - A list of Suggestion objects. - -#### Raises - -* `Exception` - Raises an exception if the underlying \_suggestions call fails. - -#### Signature - -```python -@beartype -async def suggestions( - self, - session_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Suggestion]: ... -``` - -### AsyncSessionsManager().update - -[Show source in session.py:834](../../../julep/managers/session.py#L834) - -Asynchronously update a resource with the given situation. - -This method wraps the private `_update` method which performs the actual update operation asynchronously. - -#### Arguments - -session\_id (Union\[str, UUID]): The session ID of the resource to update. It can be either a `str` or a `UUID` object. - -* `situation` _str_ - Description of the situation to update the resource with. - -#### Returns - -* `ResourceUpdatedResponse` - An object representing the response after updating the resource. - -#### Notes - -This function is decorated with `@beartype`, which will perform runtime type checking on the arguments. - -#### Raises - -* `BeartypeCallHintParamViolation` - If the `session_id` or `situation` arguments do not match their annotated types. - -#### Signature - -```python -@beartype -async def update( - self, session_id: Union[str, UUID], situation: str -) -> ResourceUpdatedResponse: ... -``` - -## BaseSessionsManager - -[Show source in session.py:28](../../../julep/managers/session.py#L28) - -A class to manage sessions using base API client methods. - -This manager handles CRUD operations and additional actions on the session data, such as chatting and retrieving history or suggestions. - -#### Attributes - -* `api_client` - The client used for communicating with an API. - -#### Methods - -\_get(id): Retrieve a specific session by its identifier. - -#### Arguments - -id (Union\[str, UUID]): The unique identifier for the session. - -user\_id (Union\[str, UUID]): The unique identifier for the user. agent\_id (Union\[str, UUID]): The unique identifier for the agent. - -* `situation` _Optional\[str]_ - An optional description of the situation for the session. -* `limit` _Optional\[int]_ - The limit on the number of items to be retrieved. -* `offset` _Optional\[int]_ - The number of items to be skipped before starting to collect the result set. - -session\_id (Union\[str, UUID]): The unique identifier for the session to be deleted. - -session\_id (Union\[str, UUID]): The unique identifier for the session to be updated. - -* `situation` _str_ - The new situation description for the session. -* `session_id` _str_ - The unique identifier for the session. -* `messages` _List\[InputChatMlMessage]_ - The list of input chat messages to be sent. -* `tools` _Optional\[List\[Tool]]_ - ... -* `tool_choice` _Optional\[ToolChoiceOption]_ - ... -* `...` - Other optional parameters for chat settings and modifiers. - -session\_id (Union\[str, UUID]): The unique identifier for the session. - -* `limit` _Optional\[int]_ - The limit on the number of suggestions to be retrieved. -* `offset` _Optional\[int]_ - The number of suggestions to be skipped before starting to collect the result set. - -session\_id (Union\[str, UUID]): The unique identifier for the session. - -* `limit` _Optional\[int]_ - The limit on the number of history entries to be retrieved. -* `offset` _Optional\[int]_ - The number of history entries to be skipped before starting to collect the result set. - -#### Returns - -* `Union[Session,` _Awaitable\[Session]]_ - The session object or an awaitable yielding it. - -\_create(user\_id, agent\_id, situation): Create a new session with specified user and agent identifiers. - -* `Union[ResourceCreatedResponse,` _Awaitable\[ResourceCreatedResponse]]_ - The response for the created session or an awaitable yielding it. - -\_list\_items(limit, offset): List multiple session items with optional pagination. - -* `Union[ListSessionsResponse,` _Awaitable\[ListSessionsResponse]]_ - The list of sessions or an awaitable yielding it. - -\_delete(session\_id): Delete a session by its identifier. - -* `Union[None,` _Awaitable\[None]]_ - None or an awaitable yielding None if the operation is successful. - -\_update(session\_id, situation): Update the situation for an existing session. - -* `Union[ResourceUpdatedResponse,` _Awaitable\[ResourceUpdatedResponse]]_ - The response for the updated session or an awaitable yielding it. - -\_chat(session\_id, messages, ...): Send chat messages and get responses during a session. - -* `Union[ChatResponse,` _Awaitable\[ChatResponse]]_ - The chat response for the session or an awaitable yielding it. - -\_suggestions(session\_id, limit, offset): Get suggestions for a session. - -* `Union[GetSuggestionsResponse,` _Awaitable\[GetSuggestionsResponse]]_ - The suggestions response for the session or an awaitable yielding it. - -\_history(session\_id, limit, offset): Get the history for a session. - -* `Union[GetHistoryResponse,` _Awaitable\[GetHistoryResponse]]_ - The history response for the session or an awaitable yielding it. - -#### Signature - -```python -class BaseSessionsManager(BaseManager): ... -``` - -### BaseSessionsManager().\_chat - -[Show source in session.py:240](../../../julep/managers/session.py#L240) - -Conducts a chat conversation with an AI model using specific parameters. - -#### Arguments - -* `session_id` _str_ - A unique identifier for the chat session. -* `messages` _List\[InputChatMlMessage]_ - A list of input messages for the AI to respond to. -* `tools` _Optional\[List\[Tool]]_ - A list of tools to be used during the chat session. -* `tool_choice` _Optional\[ToolChoiceOption]_ - A method for choosing which tools to apply. -* `frequency_penalty` _Optional\[float]_ - A modifier to decrease the likelihood of frequency-based repetitions. -* `length_penalty` _Optional\[float]_ - A modifier to control the length of the generated responses. logit\_bias (Optional\[Dict\[str, Optional\[int]]]): Adjustments to the likelihood of specific tokens appearing. -* `max_tokens` _Optional\[int]_ - The maximum number of tokens to generate in the output. -* `presence_penalty` _Optional\[float]_ - A modifier to control for new concepts' appearance. -* `repetition_penalty` _Optional\[float]_ - A modifier to discourage repetitive responses. -* `response_format` _Optional\[ChatSettingsResponseFormat]_ - The format in which the response is to be delivered. -* `seed` _Optional\[int]_ - An integer to seed the random number generator for reproducibility. -* `stop` _Optional\[ChatSettingsStop]_ - Tokens at which to stop generating further tokens. -* `stream` _Optional\[bool]_ - Whether to stream the response or deliver it when it's complete. -* `temperature` _Optional\[float]_ - A value to control the randomness of the output. -* `top_p` _Optional\[float]_ - A value to control the nucleus sampling, i.e., the cumulative probability cutoff. -* `recall` _Optional\[bool]_ - A flag to control the recall capability of the AI model. -* `remember` _Optional\[bool]_ - A flag to control the persistence of the chat history in the AI's memory. - -#### Returns - -* `Union[ChatResponse,` _Awaitable\[ChatResponse]]_ - The response from the AI given the input messages and parameters. This could be a synchronous `ChatResponse` object or an asynchronous `Awaitable[ChatResponse]` if the `stream` parameter is True. - -#### Notes - -The precise types of some arguments, like `Tool`, `ToolChoiceOption`, `ChatSettingsResponseFormat`, and `ChatSettingsStop`, are not defined within the given context. It's assumed that these types have been defined elsewhere in the code base. - -#### Raises - -It is not specified what exceptions this function might raise. Typically, one would expect potential exceptions to be associated with the underlying API client's `chat` method failure modes, such as network issues, invalid parameters, etc. - -#### Signature - -```python -def _chat( - self, - session_id: str, - messages: List[InputChatMlMessage], - tools: Optional[List[Tool]] = None, - tool_choice: Optional[ToolChoiceOption] = None, - frequency_penalty: Optional[float] = None, - length_penalty: Optional[float] = None, - logit_bias: Optional[Dict[str, Optional[int]]] = None, - max_tokens: Optional[int] = None, - presence_penalty: Optional[float] = None, - repetition_penalty: Optional[float] = None, - response_format: Optional[ChatSettingsResponseFormat] = None, - seed: Optional[int] = None, - stop: Optional[ChatSettingsStop] = None, - stream: Optional[bool] = None, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - recall: Optional[bool] = None, - remember: Optional[bool] = None, -) -> Union[ChatResponse, Awaitable[ChatResponse]]: ... -``` - -### BaseSessionsManager().\_create - -[Show source in session.py:140](../../../julep/managers/session.py#L140) - -Creates a session for a specified user and agent. - -This internal method is responsible for creating a session using the API client. It validates that both the user and agent IDs are valid UUID v4 strings before proceeding with session creation. - -#### Arguments - -user\_id (Union\[str, UUID]): The user's identifier which could be a string or a UUID object. agent\_id (Union\[str, UUID]): The agent's identifier which could be a string or a UUID object. - -* `situation` _Optional\[str], optional_ - An optional description of the situation. - -#### Returns - -* `Union[ResourceCreatedResponse,` _Awaitable\[ResourceCreatedResponse]]_ - The response from the API client upon successful session creation, which can be a synchronous `ResourceCreatedResponse` or an asynchronous `Awaitable` of it. - -#### Raises - -* `AssertionError` - If either `user_id` or `agent_id` is not a valid UUID v4. - -#### Signature - -```python -def _create( - self, - user_id: Union[str, UUID], - agent_id: Union[str, UUID], - situation: Optional[str] = None, -) -> Union[ResourceCreatedResponse, Awaitable[ResourceCreatedResponse]]: ... -``` - -### BaseSessionsManager().\_delete - -[Show source in session.py:194](../../../julep/managers/session.py#L194) - -Delete a session given its session ID. - -This is an internal method that asserts the provided session\_id is a valid UUID v4 before making the delete request through the API client. - -Args: session\_id (Union\[str, UUID]): The session identifier, which should be a valid UUID v4. - -Returns: Union\[None, Awaitable\[None]]: The result of the delete operation, which can be either None or an Awaitable that resolves to None, depending on whether this is a synchronous or asynchronous call. - -Raises: AssertionError: If the `session_id` is not a valid UUID v4. - -#### Signature - -```python -def _delete(self, session_id: Union[str, UUID]) -> Union[None, Awaitable[None]]: ... -``` - -### BaseSessionsManager().\_get - -[Show source in session.py:124](../../../julep/managers/session.py#L124) - -Get a session by its ID. - -#### Arguments - -id (Union\[str, UUID]): A string or UUID representing the session ID. - -#### Returns - -* `Union[Session,` _Awaitable\[Session]]_ - The session object associated with the given ID, which can be either a `Session` instance or an `Awaitable` that resolves to a `Session`. - -#### Raises - -* `AssertionError` - If the id is not a valid UUID v4. - -#### Signature - -```python -def _get(self, id: Union[str, UUID]) -> Union[Session, Awaitable[Session]]: ... -``` - -### BaseSessionsManager().\_history - -[Show source in session.py:338](../../../julep/managers/session.py#L338) - -Retrieve a session's history with optional pagination controls. - -Args: session\_id (Union\[str, UUID]): Unique identifier for the session whose history is being queried. Can be a string or a UUID object. limit (Optional\[int], optional): The maximum number of history entries to retrieve. Defaults to None, which uses the API's default setting. offset (Optional\[int], optional): The number of initial history entries to skip. Defaults to None, which means no offset is applied. - -Returns: Union\[GetHistoryResponse, Awaitable\[GetHistoryResponse]]: The history response object, which may be either synchronous or asynchronous (awaitable), depending on the API client configuration. - -#### Signature - -```python -def _history( - self, - session_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> Union[GetHistoryResponse, Awaitable[GetHistoryResponse]]: ... -``` - -### BaseSessionsManager().\_list\_items - -[Show source in session.py:173](../../../julep/managers/session.py#L173) - -List items with optional pagination. - -#### Arguments - -* `limit` _Optional\[int]_ - The maximum number of items to return. Defaults to None. -* `offset` _Optional\[int]_ - The number of items to skip before starting to collect the result set. Defaults to None. - -#### Returns - -* `Union[ListSessionsResponse,` _Awaitable\[ListSessionsResponse]]_ - The response object containing the list of items or an awaitable response object if called asynchronously. - -#### Notes - -The '\_list\_items' function is assumed to be a method of a class that has an 'api\_client' attribute capable of listing sessions. - -#### Signature - -```python -def _list_items( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> Union[ListSessionsResponse, Awaitable[ListSessionsResponse]]: ... -``` - -### BaseSessionsManager().\_suggestions - -[Show source in session.py:315](../../../julep/managers/session.py#L315) - -Retrieve a list of suggestions for a given session. - -Args: session\_id (Union\[str, UUID]): The ID of the session for which to get suggestions. limit (Optional\[int], optional): The maximum number of suggestions to retrieve. Defaults to None. offset (Optional\[int], optional): The offset from where to start retrieving suggestions. Defaults to None. - -Returns: Union\[GetSuggestionsResponse, Awaitable\[GetSuggestionsResponse]]: The response containing the list of suggestions synchronously or asynchronously, depending on the API client. - -#### Signature - -```python -def _suggestions( - self, - session_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> Union[GetSuggestionsResponse, Awaitable[GetSuggestionsResponse]]: ... -``` - -### BaseSessionsManager().\_update - -[Show source in session.py:215](../../../julep/managers/session.py#L215) - -Update a session with a given situation. - -#### Arguments - -session\_id (Union\[str, UUID]): The session identifier, which can be a string-formatted UUID or an actual UUID object. - -* `situation` _str_ - A string describing the current situation. - -#### Returns - -* `Union[ResourceUpdatedResponse,` _Awaitable\[ResourceUpdatedResponse]]_ - The response from the update operation, which can be either synchronous or asynchronous. - -#### Raises - -* `AssertionError` - If `session_id` is not a valid UUID v4. - -#### Signature - -```python -def _update( - self, session_id: Union[str, UUID], situation: str -) -> Union[ResourceUpdatedResponse, Awaitable[ResourceUpdatedResponse]]: ... -``` - -## SessionsManager - -[Show source in session.py:367](../../../julep/managers/session.py#L367) - -A class responsible for managing session interactions. - -This class extends [BaseSessionsManager](session.md#basesessionsmanager) and provides methods to get, create, list, delete, and update sessions, as well as to initiate a chat within a session, request suggestions, and access session history. - -#### Methods - -* `get` _(id_ - Union\[str, UUID]) -> Session: Retrieves a session by its identifier. - -create ( \*, - `user_id` - Union\[str, UUID], - `agent_id` - Union\[str, UUID], - `situation` - Optional\[str]=None ) -> ResourceCreatedResponse: Creates a new session given a user ID and an agent ID, and optionally a description of the situation. - -list ( \*, - `limit` - Optional\[int]=None, - `offset` - Optional\[int]=None ) -> List\[Session]: Lists sessions with optional pagination via limit and offset. - -* `delete` _(session\_id_ - Union\[str, UUID]): Deletes a session identified by the given session ID. - -update ( \*, - `session_id` - Union\[str, UUID], - `situation` - str ) -> ResourceUpdatedResponse: Updates the situation of a specific session by its ID. - -chat ( \*args see full method signature for detailed arguments ) -> ChatResponse: Initiates a chat in the given session with messages and various settings, including tools, penalties, biases, tokens, response format, etc. - -suggestions ( \*, - `session_id` - Union\[str, UUID], - `limit` - Optional\[int]=None, - `offset` - Optional\[int]=None ) -> List\[Suggestion]: Retrieves a list of suggestions for a given session, supported by optional pagination parameters. - -history ( \*, - `session_id` - Union\[str, UUID], - `limit` - Optional\[int]=None, - `offset` - Optional\[int]=None ) -> List\[ChatMlMessage]: Retrieves the chat history for a given session, supported by optional pagination parameters. - -Each method is decorated with `@beartype` for runtime type enforcement. - -#### Signature - -```python -class SessionsManager(BaseSessionsManager): ... -``` - -#### See also - -* [BaseSessionsManager](session.md#basesessionsmanager) - -### SessionsManager().chat - -[Show source in session.py:553](../../../julep/managers/session.py#L553) - -Initiate a chat session with the provided inputs and configurations. - -#### Arguments - -* `session_id` _str_ - Unique identifier for the chat session. -* `messages` _List\[InputChatMlMessage]_ - List of messages to send in the chat session. -* `tools` _Optional\[List\[Tool]], optional_ - List of tools to be used in the session. Defaults to None. -* `tool_choice` _Optional\[ToolChoiceOption], optional_ - The choice of tool to optimize response for. Defaults to None. -* `frequency_penalty` _Optional\[float], optional_ - Penalty for frequent tokens to control repetition. Defaults to None. -* `length_penalty` _Optional\[float], optional_ - Penalty for longer responses to control verbosity. Defaults to None. logit\_bias (Optional\[Dict\[str, Optional\[int]]], optional): Bias for or against specific tokens. Defaults to None. -* `max_tokens` _Optional\[int], optional_ - Maximum number of tokens to generate in the response. Defaults to None. -* `presence_penalty` _Optional\[float], optional_ - Penalty for new tokens to control topic introduction. Defaults to None. -* `repetition_penalty` _Optional\[float], optional_ - Penalty to discourage repetition. Defaults to None. -* `response_format` _Optional\[ChatSettingsResponseFormat], optional_ - Format of the response. Defaults to None. -* `seed` _Optional\[int], optional_ - Random seed for deterministic responses. Defaults to None. -* `stop` _Optional\[ChatSettingsStop], optional_ - Sequence at which to stop generating further tokens. Defaults to None. -* `stream` _Optional\[bool], optional_ - Whether to stream responses or not. Defaults to None. -* `temperature` _Optional\[float], optional_ - Sampling temperature for randomness in the response. Defaults to None. -* `top_p` _Optional\[float], optional_ - Nucleus sampling parameter to control diversity. Defaults to None. -* `recall` _Optional\[bool], optional_ - Whether to allow recalling previous parts of the chat. Defaults to None. -* `remember` _Optional\[bool], optional_ - Whether to allow the model to remember previous chats. Defaults to None. - -#### Returns - -* `ChatResponse` - The response object after processing chat messages. - -#### Notes - -The 'beartype' decorator is used for runtime type checking. - -#### Signature - -```python -@beartype -def chat( - self, - session_id: str, - messages: List[InputChatMlMessage], - tools: Optional[List[Tool]] = None, - tool_choice: Optional[ToolChoiceOption] = None, - frequency_penalty: Optional[float] = None, - length_penalty: Optional[float] = None, - logit_bias: Optional[Dict[str, Optional[int]]] = None, - max_tokens: Optional[int] = None, - presence_penalty: Optional[float] = None, - repetition_penalty: Optional[float] = None, - response_format: Optional[ChatSettingsResponseFormat] = None, - seed: Optional[int] = None, - stop: Optional[ChatSettingsStop] = None, - stream: Optional[bool] = None, - temperature: Optional[float] = None, - top_p: Optional[float] = None, - recall: Optional[bool] = None, - remember: Optional[bool] = None, -) -> ChatResponse: ... -``` - -### SessionsManager().create - -[Show source in session.py:450](../../../julep/managers/session.py#L450) - -Create a new resource with a user ID and an agent ID, optionally including a situation description. - -#### Arguments - -user\_id (Union\[str, UUID]): The unique identifier for the user. agent\_id (Union\[str, UUID]): The unique identifier for the agent. - -* `situation` _Optional\[str]_ - An optional description of the situation. - -#### Returns - -* `ResourceCreatedResponse` - An object containing details about the newly created resource. - -#### Raises - -* `BeartypeException` - If the provided `user_id` or `agent_id` do not match the required type. Any other exception that `_create` might raise. - -#### Signature - -```python -@beartype -def create( - self, - user_id: Union[str, UUID], - agent_id: Union[str, UUID], - situation: Optional[str] = None, -) -> ResourceCreatedResponse: ... -``` - -### SessionsManager().delete - -[Show source in session.py:506](../../../julep/managers/session.py#L506) - -Deletes a session based on its session ID. - -#### Arguments - -session\_id (Union\[str, UUID]): The session ID to be deleted, which can be a string or a UUID object. - -#### Returns - -The result from the internal `_delete` method call. - -#### Raises - -The specific exceptions that `self._delete` might raise, which should be documented in its docstring. - -#### Signature - -```python -@beartype -def delete(self, session_id: Union[str, UUID]): ... -``` - -### SessionsManager().get - -[Show source in session.py:433](../../../julep/managers/session.py#L433) - -Retrieve a Session object based on a given identifier. - -Args: id (Union\[str, UUID]): The identifier of the session, which can be either a string or a UUID. - -Returns: Session: The session object associated with the given id. - -Raises: TypeError: If the id is neither a string nor a UUID. KeyError: If the session with the given id does not exist. - -#### Signature - -```python -@beartype -def get(self, id: Union[str, UUID]) -> Session: ... -``` - -### SessionsManager().history - -[Show source in session.py:660](../../../julep/managers/session.py#L660) - -Retrieve a history of ChatMl messages for a given session. - -This method uses the private method `_history` to fetch the message history and returns a list of ChatMlMessage objects. - -Args: session\_id (Union\[str, UUID]): The session identifier to fetch the chat history for. limit (Optional\[int], optional): The maximum number of messages to return. If None, no limit is applied. Defaults to None. offset (Optional\[int], optional): The offset from where to start fetching messages. If None, no offset is applied. Defaults to None. - -Returns: List\[ChatMlMessage]: A list of ChatMlMessage objects representing the history of messages for the session. - -#### Signature - -```python -@beartype -def history( - self, - session_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[ChatMlMessage]: ... -``` - -### SessionsManager().list - -[Show source in session.py:479](../../../julep/managers/session.py#L479) - -Retrieve a list of Session objects with optional pagination. - -Args: limit (Optional\[int]): The maximum number of Session objects to return. Defaults to None, which indicates no limit. offset (Optional\[int]): The number of items to skip before starting to return the results. Defaults to None, which indicates no offset. - -Returns: List\[Session]: A list of Session objects meeting the criteria. - -Raises: BeartypeException: If the input arguments do not match their annotated types. - -#### Signature - -```python -@beartype -def list( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> List[Session]: ... -``` - -### SessionsManager().suggestions - -[Show source in session.py:626](../../../julep/managers/session.py#L626) - -Provides a list of suggestion objects based on the given session ID. - -This method retrieves suggestions and is decorated with `beartype` for runtime type checking of the passed arguments. - -#### Arguments - -session\_id (Union\[str, UUID]): The ID of the session to retrieve suggestions for. - -* `limit` _Optional\[int], optional_ - The maximum number of suggestions to return. Defaults to None, which means no limit. -* `offset` _Optional\[int], optional_ - The number to offset the list of returned suggestions by. Defaults to None, which means no offset. - -#### Returns - -* `List[Suggestion]` - A list of suggestion objects. - -#### Raises - -Any exceptions that `_suggestions` might raise, for example, if the method is unable to retrieve suggestions based on the provided session ID. - -#### Signature - -```python -@beartype -def suggestions( - self, - session_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Suggestion]: ... -``` - -### SessionsManager().update - -[Show source in session.py:522](../../../julep/managers/session.py#L522) - -Updates the state of a resource based on a given situation. - -This function is type-checked using beartype to ensure that the `session_id` parameter is either a string or a UUID and that the `situation` parameter is a string. It delegates the actual update process to an internal method '\_update'. - -#### Arguments - -session\_id (Union\[str, UUID]): The session identifier, which can be a UUID or a string that uniquely identifies the session. - -* `situation` _str_ - A string that represents the new situation for the resource update. - -#### Returns - -* `ResourceUpdatedResponse` - An object representing the response after updating the resource, typically including status and any relevant data. - -#### Notes - -The `@beartype` decorator is used for runtime type checking of the function arguments. - -#### Signature - -```python -@beartype -def update( - self, session_id: Union[str, UUID], situation: str -) -> ResourceUpdatedResponse: ... -``` diff --git a/docs/sdks/python-sdk-docs/tool.md b/docs/sdks/python-sdk-docs/tool.md deleted file mode 100644 index a55f771c0..000000000 --- a/docs/sdks/python-sdk-docs/tool.md +++ /dev/null @@ -1,450 +0,0 @@ -# Tools - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Managers](../../python-sdk-docs/julep/managers/index.md#managers) / Tool - -> Auto-generated documentation for [julep.managers.tool](../../../julep/managers/tool.py) module. - -* [Tool](tool.md#tool) - * [AsyncToolsManager](tool.md#asynctoolsmanager) - * [BaseToolsManager](tool.md#basetoolsmanager) - * [ToolsManager](tool.md#toolsmanager) - -## AsyncToolsManager - -[Show source in tool.py:344](../../../julep/managers/tool.py#L344) - -A manager for asynchronous tools handling. - -This class provides async methods to manage tools, allowing create, retrieve, update, and delete operations. - -Methods: get: Asynchronously retrieves tools associated with an agent. create: Asynchronously creates a new tool associated with an agent. delete: Asynchronously deletes a tool associated with an agent. update: Asynchronously updates a tool associated with an agent. - -Attributes: Inherited from BaseToolsManager. - -#### Signature - -```python -class AsyncToolsManager(BaseToolsManager): ... -``` - -#### See also - -* [BaseToolsManager](tool.md#basetoolsmanager) - -### AsyncToolsManager().create - -[Show source in tool.py:395](../../../julep/managers/tool.py#L395) - -Create a new resource asynchronously. - -This method creates a new resource using the provided `agent_id` and `tool` information. - -#### Arguments - -agent\_id (Union\[str, UUID]): The identifier of the agent, which can be a string or a UUID object. - -* `tool` _ToolDict_ - A dictionary containing tool-specific data. - -#### Returns - -* `ResourceCreatedResponse` - An object representing the response received after creating the resource. - -#### Raises - -* `BeartypeException` - If the type of any argument does not match the expected type. - -#### Signature - -```python -@beartype -async def create( - self, agent_id: Union[str, UUID], tool: ToolDict -) -> ResourceCreatedResponse: ... -``` - -### AsyncToolsManager().delete - -[Show source in tool.py:422](../../../julep/managers/tool.py#L422) - -Asynchronously delete a specified agent-tool association. - -This function is a high-level asynchronous API that delegates to a private coroutinal method `_delete` to perform the actual deletion based on the provided `agent_id` and `tool_id`. - -Args: agent\_id (Union\[str, UUID]): The unique identifier of the agent. tool\_id (Union\[str, UUID]): The unique identifier of the tool. - -Returns: The return type is not explicitly stated in the function signature. Typically, the returned value would be documented here, but you may need to investigate the implementation of `_delete` to determine what it returns. - -Raises: The exceptions that this function might raise are not stated in the snippet provided. If the private method `_delete` raises any exceptions, they should be documented here. Depending on the implementation, common exceptions might include `ValueError` if identifiers are invalid or `RuntimeError` if deletion fails. - -#### Signature - -```python -@beartype -async def delete(self, agent_id: Union[str, UUID], tool_id: Union[str, UUID]): ... -``` - -### AsyncToolsManager().get - -[Show source in tool.py:360](../../../julep/managers/tool.py#L360) - -Asynchronously get a list of Tool objects based on provided filters. - -This method fetches Tool objects with the option to limit the results and offset them, to allow for pagination. - -#### Arguments - -agent\_id (Union\[str, UUID]): The unique identifier of the agent for which to fetch tools. - -* `limit` _Optional\[int], optional_ - The maximum number of tools to return. Defaults to None, which implies no limit. -* `offset` _Optional\[int], optional_ - The number of tools to skip before starting to return the tools. Defaults to None, which means start from the beginning. - -#### Returns - -* `List[Tool]` - A list of Tool objects that match the criteria. - -#### Notes - -This function is decorated with beartype, which assures that the input arguments adhere to the specified types at runtime. It is an asynchronous function and should be called with `await`. - -#### Signature - -```python -@beartype -async def get( - self, - agent_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Tool]: ... -``` - -### AsyncToolsManager().update - -[Show source in tool.py:458](../../../julep/managers/tool.py#L458) - -Asynchronously updates a resource identified by the agent\_id and tool\_id with a new definition. - -This function is type-enforced using the `beartype` decorator. - -#### Arguments - -agent\_id (Union\[str, UUID]): The unique identifier for the agent. tool\_id (Union\[str, UUID]): The unique identifier for the tool. - -* `function` _FunctionDefDict_ - A dictionary containing the function definition which needs to be updated. - -#### Returns - -* `ResourceUpdatedResponse` - An object representing the response received after updating the resource. - -#### Raises - -This will depend on the implementation of the `_update` method and any exceptions that it raises. - -#### Signature - -```python -@beartype -async def update( - self, - agent_id: Union[str, UUID], - tool_id: Union[str, UUID], - function: FunctionDefDict, -) -> ResourceUpdatedResponse: ... -``` - -## BaseToolsManager - -[Show source in tool.py:21](../../../julep/managers/tool.py#L21) - -A class to manage base tools by interacting with an API client. - -This class provides an interface for creating, reading, updating, and deleting tools, where each tool is associated with an agent. - -#### Attributes - -* `api_client` - The API client utilized to send requests to the service. - -#### Methods - -* `_get(self,` _agent\_id_ - Union\[str, UUID], limit: Optional\[int]=None, offset: Optional\[int]=None) -> Union\[GetAgentToolsResponse, Awaitable\[GetAgentToolsResponse]]: Retrieve a list of tools associated with the given agent using the API client. -* `_create(self,` _agent\_id_ - Union\[str, UUID], tool: ToolDict) -> Union\[ResourceCreatedResponse, Awaitable\[ResourceCreatedResponse]]: Create a new tool associated with the given agent using the API client. -* `_update(self,` _agent\_id_ - Union\[str, UUID], tool\_id: Union\[str, UUID], function: FunctionDefDict) -> Union\[ResourceUpdatedResponse, Awaitable\[ResourceUpdatedResponse]]: Update the definition of an existing tool associated with the given agent using the API client. -* `_delete(self,` _agent\_id_ - Union\[str, UUID], tool\_id: Union\[str, UUID]): Delete a tool associated with the given agent using the API client. - -#### Notes - -All methods assert the validity of UUIDs for agent\_id and tool\_id when applicable. The \_get, \_create, and \_update methods may return either synchronous or asynchronous responses, indicated by the return type Union\[..., Awaitable\[...]]. - -#### Signature - -```python -class BaseToolsManager(BaseManager): ... -``` - -### BaseToolsManager().\_create - -[Show source in tool.py:80](../../../julep/managers/tool.py#L80) - -Create a new tool associated with a given agent. - -Args: agent\_id (Union\[str, UUID]): The ID of the agent for which to create the tool. Must be a valid UUID v4. tool (ToolDict): A dictionary with tool data conforming to the CreateToolRequest structure. - -Returns: Union\[ResourceCreatedResponse, Awaitable\[ResourceCreatedResponse]]: The response object indicating the newly created tool, either as a direct response or as an awaitable if it's an asynchronous operation. - -#### Signature - -```python -def _create( - self, agent_id: Union[str, UUID], tool: ToolDict -) -> Union[ResourceCreatedResponse, Awaitable[ResourceCreatedResponse]]: ... -``` - -### BaseToolsManager().\_delete - -[Show source in tool.py:137](../../../julep/managers/tool.py#L137) - -Delete a tool associated with an agent. - -Args: agent\_id (Union\[str, UUID]): The UUID of the agent. tool\_id (Union\[str, UUID]): The UUID of the tool to be deleted. - -Returns: The response from the API client's delete\_agent\_tool method. - -Raises: AssertionError: If either `agent_id` or `tool_id` is not a valid UUID v4. - -#### Signature - -```python -def _delete(self, agent_id: Union[str, UUID], tool_id: Union[str, UUID]): ... -``` - -### BaseToolsManager().\_get - -[Show source in tool.py:48](../../../julep/managers/tool.py#L48) - -Retrieve tools associated with the given agent. - -This is a private method that fetches tools for the provided agent ID, with optional limit and offset parameters for pagination. - -#### Arguments - -agent\_id (Union\[str, UUID]): The unique identifier for the agent, which can be a string or UUID object. - -* `limit` _Optional\[int], optional_ - The maximum number of tools to retrieve. Defaults to None. -* `offset` _Optional\[int], optional_ - The number of tools to skip before starting to collect the result set. Defaults to None. - -#### Returns - -* `Union[GetAgentToolsResponse,` _Awaitable\[GetAgentToolsResponse]]_ - The response object which contains the list of tools, or an awaitable response object for asynchronous operations. - -#### Raises - -* `AssertionError` - If the agent\_id is not a valid UUID v4. - -#### Signature - -```python -def _get( - self, - agent_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> Union[GetAgentToolsResponse, Awaitable[GetAgentToolsResponse]]: ... -``` - -### BaseToolsManager().\_update - -[Show source in tool.py:105](../../../julep/managers/tool.py#L105) - -Update the tool definition for a given agent. - -Args: agent\_id (Union\[str, UUID]): The unique identifier for the agent, either in string or UUID format. tool\_id (Union\[str, UUID]): The unique identifier for the tool, either in string or UUID format. function (FunctionDefDict): A dictionary containing the function definition that conforms with the required API schema. - -Returns: Union\[ResourceUpdatedResponse, Awaitable\[ResourceUpdatedResponse]]: The updated resource response sync or async. - -Raises: AssertionError: If the `agent_id` or `tool_id` is not a valid UUID v4. - -#### Signature - -```python -def _update( - self, - agent_id: Union[str, UUID], - tool_id: Union[str, UUID], - function: FunctionDefDict, -) -> Union[ResourceUpdatedResponse, Awaitable[ResourceUpdatedResponse]]: ... -``` - -## ToolsManager - -[Show source in tool.py:165](../../../julep/managers/tool.py#L165) - -A manager class for handling tools related to agents. - -This class provides an interface to manage tools, including their retrieval, creation, deletion, and updating. It extends the functionalities of the BaseToolsManager. - -#### Methods - -get: Retrieves a list of tools for the given agent. - -#### Arguments - -agent\_id (Union\[str, UUID]): The identifier of the agent whose tools are being retrieved. - -* `limit` _Optional\[int], optional_ - The maximum number of tools to retrieve. -* `offset` _Optional\[int], optional_ - The index from which to start the retrieval. - -agent\_id (Union\[str, UUID]): The identifier of the agent for whom the tool is being created. - -* `tool` _ToolDict_ - A dictionary of tool attributes. - -agent\_id (Union\[str, UUID]): The identifier of the agent whose tool is being deleted. tool\_id (Union\[str, UUID]): The unique identifier of the tool to be deleted. - -update: Updates the definition of an existing tool for the given agent. - -agent\_id (Union\[str, UUID]): The identifier of the agent whose tool is being updated. tool\_id (Union\[str, UUID]): The unique identifier of the tool to be updated. - -* `function` _FunctionDefDict_ - A dictionary representing the definition of the tool to be updated. - -#### Returns - -* `List[Tool]` - A list of Tool objects. - -create: Creates a new tool for the given agent. - -* `ResourceCreatedResponse` - An object indicating the successful creation of the tool. - -delete: Deletes a tool for the given agent. - -* `ResourceUpdatedResponse` - An object indicating the successful update of the tool. - -Inherits: - [BaseToolsManager](tool.md#basetoolsmanager) - A base class that defines the basic operations for tool management. - -#### Signature - -```python -class ToolsManager(BaseToolsManager): ... -``` - -#### See also - -* [BaseToolsManager](tool.md#basetoolsmanager) - -### ToolsManager().create - -[Show source in tool.py:247](../../../julep/managers/tool.py#L247) - -Create a new resource with the provided agent identifier and tool information. - -This method wraps the internal `_create` method to construct and return a ResourceCreatedResponse. - -Args: agent\_id (Union\[str, UUID]): The unique identifier for the agent. Can be a string or a UUID object. tool (ToolDict): A dictionary containing tool-specific configuration or information. - -Returns: ResourceCreatedResponse: An object representing the successfully created resource, including metadata like creation timestamps and resource identifiers. - -Raises: TypeError: If the `agent_id` or `tool` arguments are not of the expected type. ValueError: If any values within the `tool` dictionary are invalid or out of accepted range. RuntimeError: If the creation process encounters an unexpected error. - -Note: The `@beartype` decorator is used to enforce type checking of the arguments at runtime. - -Example usage: - -```python ->>> response = instance.create(agent_id="123e4567-e89b-12d3-a456-426614174000", tool={"type": "screwdriver", "size": "M4"}) ->>> print(response) -ResourceCreatedResponse(resource_id='abcde-12345', created_at='2021-01-01T12:00:00Z') -``` - -#### Signature - -```python -@beartype -def create( - self, agent_id: Union[str, UUID], tool: ToolDict -) -> ResourceCreatedResponse: ... -``` - -### ToolsManager().delete - -[Show source in tool.py:285](../../../julep/managers/tool.py#L285) - -Deletes an agent's access to a specific tool. - -#### Arguments - -agent\_id (Union\[str, UUID]): The unique identifier of the agent. tool\_id (Union\[str, UUID]): The unique identifier of the tool. - -#### Returns - -The result of the delete operation, the specific type of which may depend on the implementation of `_delete`. - -#### Raises - -* `Beartype` _exceptions_ - If `agent_id` or `tool_id` are of the wrong type. - -#### Signature - -```python -@beartype -def delete(self, agent_id: Union[str, UUID], tool_id: Union[str, UUID]): ... -``` - -### ToolsManager().get - -[Show source in tool.py:216](../../../julep/managers/tool.py#L216) - -Retrieve a list of Tool objects for the specified agent. - -This method wraps the internal \_get method and returns the 'items' property from the result, which contains a list of Tool instances. - -Args: agent\_id (Union\[str, UUID]): The ID of the agent to retrieve Tool objects for. limit (Optional\[int]): The maximum number of Tool objects to return. Defaults to None, implying no limit. offset (Optional\[int]): The number to skip before starting to collect the result set. Defaults to None, implying no offset. - -Returns: List\[Tool]: A list of Tool instances associated with the specified agent ID. - -Raises: BeartypeException: If the input argument types do not match the expected types. - -#### Signature - -```python -@beartype -def get( - self, - agent_id: Union[str, UUID], - limit: Optional[int] = None, - offset: Optional[int] = None, -) -> List[Tool]: ... -``` - -### ToolsManager().update - -[Show source in tool.py:310](../../../julep/managers/tool.py#L310) - -Update a specific tool definition for an agent. - -#### Arguments - -agent\_id (Union\[str, UUID]): The unique identifier of the agent. tool\_id (Union\[str, UUID]): The unique identifier of the tool to be updated. - -* `function` _FunctionDefDict_ - A dictionary containing the new definition of the tool. - -#### Returns - -* `ResourceUpdatedResponse` - An object representing the update operation response. - -#### Notes - -This function is decorated with `beartype` which ensures that the arguments provided match the expected types at runtime. - -#### Raises - -* `BeartypeDecorHintPepParamException` - If the type of any parameter does not match the expected type. Any exceptions that `self._update` method might raise. - -#### Signature - -```python -@beartype -def update( - self, - agent_id: Union[str, UUID], - tool_id: Union[str, UUID], - function: FunctionDefDict, -) -> ResourceUpdatedResponse: ... -``` diff --git a/docs/sdks/python-sdk-docs/user.md b/docs/sdks/python-sdk-docs/user.md deleted file mode 100644 index 94c296af4..000000000 --- a/docs/sdks/python-sdk-docs/user.md +++ /dev/null @@ -1,518 +0,0 @@ -# Users - -[Julep Python SDK Index](./#julep-python-sdk-index) / [Julep](../../python-sdk-docs/julep/index.md#julep) / [Managers](../../python-sdk-docs/julep/managers/index.md#managers) / User - -> Auto-generated documentation for [julep.managers.user](../../../julep/managers/user.py) module. - -* [User](user.md#user) - * [AsyncUsersManager](user.md#asyncusersmanager) - * [BaseUsersManager](user.md#baseusersmanager) - * [UsersManager](user.md#usersmanager) - -## AsyncUsersManager - -[Show source in user.py:330](../../../julep/managers/user.py#L330) - -A class that provides asynchronous management of users extending BaseUsersManager. - -Attributes are inherited from BaseUsersManager. - -#### Methods - -get (Union\[UUID, str]) -> User: Asynchronously retrieves a user by their unique identifier (either a UUID or a string). - -create (\*, name: str, about: str, docs: List\[DocDict]=\[]) -> ResourceCreatedResponse: Asynchronously creates a new user with the given name, about description, and optional list of documents. - -list (\*, limit: Optional\[int]=None, offset: Optional\[int]=None) -> List\[User]: Asynchronously retrieves a list of users with an optional limit and offset for pagination. - -delete (\*, user\_id: Union\[str, UUID]) -> None: Asynchronously deletes a user identified by their unique ID (either a string or a UUID). - -update (\*, user\_id: Union\[str, UUID], about: Optional\[str]=None, name: Optional\[str]=None) -> ResourceUpdatedResponse: Asynchronously updates a user's information identified by their unique ID with optional new about description and name. - -#### Notes - -The beartype decorator is used for runtime type checking of the parameters passed to the methods. - -#### Signature - -```python -class AsyncUsersManager(BaseUsersManager): ... -``` - -#### See also - -* [BaseUsersManager](user.md#baseusersmanager) - -### AsyncUsersManager().create - -[Show source in user.py:374](../../../julep/managers/user.py#L374) - -Asynchronously create a new resource with the provided name, description, and documents. - -This function is decorated with `@beartype` to ensure type checking at runtime. - -#### Arguments - -* `name` _str_ - The name of the resource to be created. -* `about` _str_ - Brief information about the resource. -* `docs` _List\[DocDict], optional_ - A list of document dictionaries with structure defined by DocDict type. - -#### Returns - -* `ResourceCreatedResponse` - An instance representing the response after resource creation. - -#### Raises - -* `BeartypeException` - If any of the parameters do not match their annotated types. - -#### Signature - -```python -@beartype -async def create( - self, name: str, about: str, docs: List[DocDict] = [] -) -> ResourceCreatedResponse: ... -``` - -### AsyncUsersManager().delete - -[Show source in user.py:437](../../../julep/managers/user.py#L437) - -Asynchronously deletes a user by their user ID. - -#### Arguments - -user\_id (Union\[str, UUID]): The unique identifier of the user to delete, which can be a string or a UUID. - -#### Returns - -* `None` - This function does not return anything. - -#### Notes - -* The function is decorated with `@beartype` for runtime type checking. -* This function is a coroutine, it should be called with `await`. - -#### Raises - -* The raised exceptions depend on the implementation of the underlying `_delete` coroutine. - -#### Signature - -```python -@beartype -async def delete(self, user_id: Union[str, UUID]) -> None: ... -``` - -### AsyncUsersManager().get - -[Show source in user.py:356](../../../julep/managers/user.py#L356) - -Fetch a User object asynchronously by its identifier. - -This method retrieves a User object from some data storage asynchronously based on the provided identifier, which can be either a UUID or a string. - -#### Arguments - -id (Union\[UUID, str]): The unique identifier of the User to be retrieved. - -#### Returns - -* `User` - An instance of the User class corresponding to the given id. - -#### Raises - -* `Exception` - If the retrieval fails or the user cannot be found. - -#### Signature - -```python -@beartype -async def get(self, id: Union[UUID, str]) -> User: ... -``` - -### AsyncUsersManager().list - -[Show source in user.py:404](../../../julep/managers/user.py#L404) - -Asynchronously lists users with optional limits and offsets. - -This function applies the `beartype` decorator for runtime type checking. - -#### Arguments - -* `limit` _Optional\[int], optional_ - The maximum number of users to be returned. Defaults to None, which means no limit. -* `offset` _Optional\[int], optional_ - The number to offset the list of returned users by. Defaults to None, which means no offset. - -#### Returns - -* `List[User]` - A list of user objects. - -#### Raises - -* `TypeError` - If any input arguments are not of the expected type. Any other exception that might be raised during the retrieval of users from the data source. - -#### Notes - -The actual exception raised by the `beartype` decorator or during the users' retrieval will depend on the implementation detail of the `self._list_items` method and the `beartype` configuration. - -#### Signature - -```python -@beartype -async def list( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> List[User]: ... -``` - -### AsyncUsersManager().update - -[Show source in user.py:463](../../../julep/managers/user.py#L463) - -Asynchronously updates user details. - -This function updates user details such as 'about' and 'name'. It uses type annotations to enforce the types of the parameters and an asynchronous call to '\_update' method to perform the actual update operation. - -#### Arguments - -user\_id (Union\[str, UUID]): The unique identifier of the user, which can be either a string or a UUID. - -* `about` _Optional\[str], optional_ - A description of the user. Default is None, indicating no update. -* `name` _Optional\[str], optional_ - The name of the user. Default is None, indicating no update. - -#### Returns - -* `ResourceUpdatedResponse` - An object representing the update status. - -#### Notes - -This function is decorated with @beartype to perform runtime type checking. - -#### Signature - -```python -@beartype -async def update( - self, - user_id: Union[str, UUID], - about: Optional[str] = None, - name: Optional[str] = None, -) -> ResourceUpdatedResponse: ... -``` - -## BaseUsersManager - -[Show source in user.py:20](../../../julep/managers/user.py#L20) - -A manager class for handling user-related operations through an API client. - -This class provides high-level methods to interact with user records, such as retrieving a user by ID, creating a new user, listing all users, deleting a user, and updating a user's details. - -Attributes: api\_client: The API client instance to communicate with the user service. - -Methods: \_get: Retrieve a user by a unique UUID. \_create: Create a new user with the specified name and about fields, and optionally additional documents. \_list\_items: List users with optional pagination through limit and offset parameters. \_delete: Delete a user by UUID. \_update: Update user details such as the 'about' description and name by UUID. - -Raises: AssertionError: If the provided ID for the user operations is not a valid UUID v4. - -#### Signature - -```python -class BaseUsersManager(BaseManager): ... -``` - -### BaseUsersManager().\_create - -[Show source in user.py:63](../../../julep/managers/user.py#L63) - -Create a new resource with the given name and about information, optionally including additional docs. - -This internal method allows for creating a new resource with optional docsrmation. - -#### Arguments - -* `name` _str_ - The name of the new resource. -* `about` _str_ - A brief description about the new resource. -* `docs` _List\[DocDict], optional_ - A list of dictionaries with documentation-related information. Each dictionary must conform to the structure expected by CreateDoc. Defaults to an empty list. - -#### Returns - -* `Union[ResourceCreatedResponse,` _Awaitable\[ResourceCreatedResponse]]_ - The response indicating the resource has been created successfully. It can be either a synchronous ResourceCreatedResponse or an asynchronous Awaitable object containing a ResourceCreatedResponse. - -#### Notes - -This method is an internal API implementation detail and should not be used directly outside the defining class or module. - -Side effects: Modifies internal state by converting each doc dict to an instance of CreateDoc and uses the internal API client to create a new user resource. - -#### Signature - -```python -def _create( - self, name: str, about: str, docs: List[DocDict] = [] -) -> Union[ResourceCreatedResponse, Awaitable[ResourceCreatedResponse]]: ... -``` - -### BaseUsersManager().\_delete - -[Show source in user.py:121](../../../julep/managers/user.py#L121) - -Delete a user given their user ID. - -Args: user\_id (Union\[str, UUID]): The identifier of the user. Must be a valid UUID version 4. - -Returns: Union\[None, Awaitable\[None]]: None if the deletion is synchronous, or an Awaitable that resolves to None if the deletion is asynchronous. - -Raises: AssertionError: If the user\_id is not a valid UUID v4. - -#### Signature - -```python -def _delete(self, user_id: Union[str, UUID]) -> Union[None, Awaitable[None]]: ... -``` - -### BaseUsersManager().\_get - -[Show source in user.py:42](../../../julep/managers/user.py#L42) - -Get the user by their ID. - -This method is intended to retrieve a User object or an Awaitable User object by the user's unique identifier. The identifier can be a string representation of a UUID or a UUID object itself. - -#### Arguments - -id (Union\[str, UUID]): The unique identifier of the user to retrieve. It must be a valid UUID v4. - -#### Returns - -* `Union[User,` _Awaitable\[User]]_ - The retrieved User instance or an Awaitable that resolves to a User instance. - -#### Raises - -* `AssertionError` - If the `id` is not a valid UUID v4. - -#### Notes - -The leading underscore in the method name suggests that this method is intended for internal use and should not be a part of the public interface of the class. - -#### Signature - -```python -def _get(self, id: Union[str, UUID]) -> Union[User, Awaitable[User]]: ... -``` - -### BaseUsersManager().\_list\_items - -[Show source in user.py:102](../../../julep/managers/user.py#L102) - -Fetch a list of users, with optional pagination parameters. - -Args: limit (Optional\[int], optional): The maximum number of users to return. Defaults to None. offset (Optional\[int], optional): The offset from the start of the list to begin returning users. Defaults to None. - -Returns: Union\[ListUsersResponse, Awaitable\[ListUsersResponse]]: An instance of ListUsersResponse, or an awaitable that will resolve to it, depending on the API client implementation. - -#### Signature - -```python -def _list_items( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> Union[ListUsersResponse, Awaitable[ListUsersResponse]]: ... -``` - -### BaseUsersManager().\_update - -[Show source in user.py:138](../../../julep/managers/user.py#L138) - -Update user details for a given user ID. - -This method updates the 'about' and/or 'name' fields for the user identified by user\_id. - -#### Arguments - -user\_id (Union\[str, UUID]): The ID of the user to be updated. Must be a valid UUID v4. - -* `about` _Optional\[str], optional_ - The new information about the user. Defaults to None. -* `name` _Optional\[str], optional_ - The new name for the user. Defaults to None. - -#### Returns - -* `Union[ResourceUpdatedResponse,` _Awaitable\[ResourceUpdatedResponse]]_ - The response indicating successful update or an Awaitable that resolves to such a response. - -#### Raises - -* `AssertionError` - If `user_id` is not a valid UUID v4. - -#### Signature - -```python -def _update( - self, - user_id: Union[str, UUID], - about: Optional[str] = None, - name: Optional[str] = None, -) -> Union[ResourceUpdatedResponse, Awaitable[ResourceUpdatedResponse]]: ... -``` - -## UsersManager - -[Show source in user.py:168](../../../julep/managers/user.py#L168) - -A class responsible for managing users in a system. - -This class is a specialized version of the BaseUsersManager and provides methods for retrieving, creating, listing, deleting, and updating users within the system. - -#### Methods - -* `get(id` - Union\[str, UUID]) -> User: Retrieves a user based on their unique identifier (either a string or UUID). -* `create(*,` _name_ - str, about: str, docs: List\[DocDict]=\[]) -> ResourceCreatedResponse: Creates a new user with the specified name, description about the user, and an optional list of documents associated with the user. -* `list(*,` _limit_ - Optional\[int]=None, offset: Optional\[int]=None) -> List\[User]: Lists users in the system, with optional limit and offset for pagination. -* `delete(*,` _user\_id_ - Union\[str, UUID]) -> None: Deletes a user from the system based on their unique identifier. -* `update(*,` _user\_id_ - Union\[str, UUID], about: Optional\[str]=None, name: Optional\[str]=None) -> ResourceUpdatedResponse: Updates an existing user's information with optional new about and name fields. - -#### Signature - -```python -class UsersManager(BaseUsersManager): ... -``` - -#### See also - -* [BaseUsersManager](user.md#baseusersmanager) - -### UsersManager().create - -[Show source in user.py:215](../../../julep/managers/user.py#L215) - -Create a new resource with the specified name, about text, and associated docs. - -Args: name (str): The name of the resource to create. about (str): A brief description of the resource. docs (List\[DocDict], optional): A list of dictionaries representing the documents associated with the resource. Defaults to an empty list. - -Returns: ResourceCreatedResponse: An object representing the response received upon the successful creation of the resource. - -Note: Using mutable types like list as default argument values in Python is risky because if the list is modified, those changes will persist across subsequent calls to the function which use the default value. It is generally safer to use `None` as a default value and then set the default inside the function if needed. - -Raises: BeartypeException: If the input types do not match the specified function annotations. - -#### Signature - -```python -@beartype -def create( - self, name: str, about: str, docs: List[DocDict] = [] -) -> ResourceCreatedResponse: ... -``` - -### UsersManager().delete - -[Show source in user.py:275](../../../julep/managers/user.py#L275) - -Deletes a user based on the provided user ID. - -#### Arguments - -user\_id (Union\[str, UUID]): Unique identifier of the user. - -#### Returns - -None - -#### Notes - -This function is type-checked with `beartype` to ensure that the `user_id` parameter matches either a string or a UUID type. - -#### Raises - -The specific exceptions raised depend on the implementation of the `_delete` method this function proxies to. - -#### Signature - -```python -@beartype -def delete(self, user_id: Union[str, UUID]) -> None: ... -``` - -### UsersManager().get - -[Show source in user.py:195](../../../julep/managers/user.py#L195) - -Retrieve a User object by its identifier. - -The method supports retrieval by both string representations of a UUID and UUID objects directly. - -#### Arguments - -id (Union\[str, UUID]): The identifier of the User, can be a string or UUID. - -#### Returns - -* `User` - The User object associated with the provided id. - -#### Raises - -* `ValueError` - If 'id' is neither a string nor a UUID. -* `NotFoundError` - If a User with the given 'id' does not exist. - -#### Signature - -```python -@beartype -def get(self, id: Union[str, UUID]) -> User: ... -``` - -### UsersManager().list - -[Show source in user.py:248](../../../julep/managers/user.py#L248) - -Lists the users optionally applying limit and offset. - -#### Arguments - -* `limit` _Optional\[int], optional_ - The maximum number of users to return. None means no limit. Defaults to None. -* `offset` _Optional\[int], optional_ - The index of the first user to return. None means start from the beginning. Defaults to None. - -#### Returns - -* `List[User]` - A list of user objects. - -#### Raises - -* `BeartypeException` - If the type of `limit` or `offset` is not as expected. - -#### Signature - -```python -@beartype -def list( - self, limit: Optional[int] = None, offset: Optional[int] = None -) -> List[User]: ... -``` - -### UsersManager().update - -[Show source in user.py:302](../../../julep/managers/user.py#L302) - -Update user information. - -This method updates user details such as the `about` text and user's `name` for a given `user_id`. - -#### Arguments - -user\_id (Union\[str, UUID]): The unique identifier for the user, which can be a string or a UUID object. - -* `about(Optional[str],` _optional)_ - The descriptive information about the user. Defaults to None, indicating that `about` should not be updated if not provided. -* `name(Optional[str],` _optional)_ - The name of the user. Defaults to None, indicating that `name` should not be updated if not provided. - -#### Returns - -* `ResourceUpdatedResponse` - An object indicating the outcome of the update operation, which typically includes the status of the operation and possibly the updated resource data. - -#### Signature - -```python -@beartype -def update( - self, - user_id: Union[str, UUID], - about: Optional[str] = None, - name: Optional[str] = None, -) -> ResourceUpdatedResponse: ... -```